summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-07-15 05:59:19 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2006-07-15 11:58:27 -0700
commit1d87a98f9db06b6c7fadd20f13ab092875d53801 (patch)
tree347251b0eb0dfae600bc45dd2c325b340d173270
parent79146daf9736143f28e21c76964918e9a1151fe7 (diff)
[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 <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/proc/base.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 5a8b89a8a467..f801693f6b14 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1404,8 +1404,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;
}
@@ -1433,6 +1433,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;
}