Commit:     bbaca6c2e7ef0f663bc31be4dad7cf530f6c4962
Parent:     b599fdfdb4bb4941e9076308efcf3bb89e577db5
Author:     Stephen Smalley <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 14 00:34:16 2007 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Feb 14 08:10:00 2007 -0800

    [PATCH] selinux: enhance selinux to always ignore private inodes
    Hmmm...turns out to not be quite enough, as the /proc/sys inodes aren't 
    private to the fs, so we can run into them in a variety of security hooks
    beyond just the inode hooks, such as security_file_permission (when reading
    and writing them via the vfs helpers), security_sb_mount (when mounting 
    filesystems on directories in proc like binfmt_misc), and deeper within the
    security module itself (as in flush_unauthorized_files upon inheritance 
    execve).  So I think we have to add an IS_PRIVATE() guard within SELinux, as
    below.  Note however that the use of the private flag here could be 
    as these inodes are _not_ private to the fs, are exposed to userspace, and
    security modules must implement the sysctl hook to get any access control 
    Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Signed-off-by: Stephen Smalley <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 security/selinux/hooks.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index b8ede1c..b1ac22d 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1077,6 +1077,9 @@ static int inode_has_perm(struct task_struct *tsk,
        struct inode_security_struct *isec;
        struct avc_audit_data ad;
+       if (unlikely (IS_PRIVATE (inode)))
+               return 0;
        tsec = tsk->security;
        isec = inode->i_security;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to