Bug 197704 - investigate useage of sem in inode_security_set_sid
Summary: investigate useage of sem in inode_security_set_sid
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eric Paris
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-07-05 16:58 UTC by Eric Paris
Modified: 2007-11-30 22:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-25 20:45:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Eric Paris 2006-07-05 16:58:18 UTC
eliminate the holding of the sem in inode_security_set_sid if it is indeed not
needed.

Comment 1 Stephen Smalley 2006-07-05 17:07:29 UTC
Rationale:  isec->sem is used to synchronize inode security setup, but this is
only necessary when multiple threads may access the inode, as in
inode_doinit_with_dentry (upon lookup).  inode_security_set_sid is now only used
by inode_init_security (and could be folded into it), which is called to set up
newly created inodes before they are accessible.  I think that the taking of
isem there is legacy code. Note that taking the sem also does no good there, as
if you have multiple threads accessing the inode there, someone is going to lose
and have his value clobbered.

We should also look at converting the remaining semaphores in the SELinux code
to simple mutexes.


Comment 2 Eric Paris 2006-07-20 17:12:49 UTC
"We should also look at converting the remaining semaphores in the SELinux code
to simple mutexes."

By simpe mutexes do you mean spin locks?  Does the kernel have another locking
mechanism that would work other than spin locks and semaphores initialized to 1?

Comment 4 Eric Paris 2006-08-25 15:13:03 UTC
Posted upstream and in -mm

Comment 5 Eric Paris 2006-09-25 20:45:44 UTC
Closing current release (in 2.6.18)


Note You need to log in before you can comment on or make changes to this bug.