]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] Relax /proc fix a bit
authorLinus Torvalds <torvalds@osdl.org>
Sat, 15 Jul 2006 05:59:19 +0000 (05:59 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 15 Jul 2006 19:45:13 +0000 (12:45 -0700)
Relax /proc fix a bit

Clearign all of i_mode was a bit draconian. We only really care about
S_ISUID/ISGID, after all.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/proc/base.c

index 9d996746a1a60be96317241aeefcc444fa18162d..38f39c1834900c088a1a9da8d70a0dc0fd6340be 100644 (file)
@@ -1366,8 +1366,8 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
                } else {
                        inode->i_uid = 0;
                        inode->i_gid = 0;
-                       inode->i_mode = 0;
                }
+               inode->i_mode &= ~(S_ISUID | S_ISGID);
                security_task_to_inode(task, inode);
                return 1;
        }
@@ -1395,6 +1395,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
                                inode->i_uid = 0;
                                inode->i_gid = 0;
                        }
+                       inode->i_mode &= ~(S_ISUID | S_ISGID);
                        security_task_to_inode(task, inode);
                        return 1;
                }