From 17fe0b2d3142f81b09ece55aa5e290cdc49b4a22 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 15 Jul 2006 05:59:19 +0000 Subject: [PATCH] [PATCH] Relax /proc fix a bit 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 Signed-off-by: Greg Kroah-Hartman --- fs/proc/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 9d996746a1a6..38f39c183490 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -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; } -- 2.39.5