Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0955dc03aedfb6a5565445b3f2176255b784cc6a
Commit:     0955dc03aedfb6a5565445b3f2176255b784cc6a
Parent:     e3c0ac04f980750a368f7cd5f1b8d1d2cdc1f735
Author:     Stephen Smalley <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 21 09:01:36 2007 -0500
Committer:  James Morris <[EMAIL PROTECTED]>
CommitDate: Thu Dec 6 00:23:46 2007 +1100

    SELinux: do not clear f_op when removing entries
    
    Do not clear f_op when removing entries since it isn't safe to do.
    
    Signed-off-by:  Stephen Smalley <[EMAIL PROTECTED]>
    Signed-off-by: James Morris <[EMAIL PROTECTED]>
---
 security/selinux/selinuxfs.c |   28 +---------------------------
 1 files changed, 1 insertions(+), 27 deletions(-)

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index f5f3e6d..ac6fe99 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -838,10 +838,6 @@ static ssize_t sel_read_bool(struct file *filep, char 
__user *buf,
 
        ret = -EFAULT;
 
-       /* check to see if this file has been deleted */
-       if (!filep->f_op)
-               goto out;
-
        if (count > PAGE_SIZE) {
                ret = -EINVAL;
                goto out;
@@ -882,10 +878,6 @@ static ssize_t sel_write_bool(struct file *filep, const 
char __user *buf,
        if (length)
                goto out;
 
-       /* check to see if this file has been deleted */
-       if (!filep->f_op)
-               goto out;
-
        if (count >= PAGE_SIZE) {
                length = -ENOMEM;
                goto out;
@@ -940,10 +932,6 @@ static ssize_t sel_commit_bools_write(struct file *filep,
        if (length)
                goto out;
 
-       /* check to see if this file has been deleted */
-       if (!filep->f_op)
-               goto out;
-
        if (count >= PAGE_SIZE) {
                length = -ENOMEM;
                goto out;
@@ -982,11 +970,9 @@ static const struct file_operations sel_commit_bools_ops = 
{
        .write          = sel_commit_bools_write,
 };
 
-/* partial revoke() from fs/proc/generic.c proc_kill_inodes */
 static void sel_remove_entries(struct dentry *de)
 {
-       struct list_head *p, *node;
-       struct super_block *sb = de->d_sb;
+       struct list_head *node;
 
        spin_lock(&dcache_lock);
        node = de->d_subdirs.next;
@@ -1006,18 +992,6 @@ static void sel_remove_entries(struct dentry *de)
        }
 
        spin_unlock(&dcache_lock);
-
-       file_list_lock();
-       list_for_each(p, &sb->s_files) {
-               struct file * filp = list_entry(p, struct file, f_u.fu_list);
-               struct dentry * dentry = filp->f_path.dentry;
-
-               if (dentry->d_parent != de) {
-                       continue;
-               }
-               filp->f_op = NULL;
-       }
-       file_list_unlock();
 }
 
 #define BOOL_DIR_NAME "booleans"
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to