]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[PATCH] Fix nasty /proc vulnerability (CVE-2006-3626)
authorLinus Torvalds <torvalds@osdl.org>
Fri, 14 Jul 2006 23:59:02 +0000 (23:59 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 15 Jul 2006 02:35:20 +0000 (19:35 -0700)
Fix nasty /proc vulnerability

We have a bad interaction with both the kernel and user space being able
to change some of the /proc file status.  This fixes the most obvious
part of it, but I expect we'll also make it harder for users to modify
even their "own" files in /proc.

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

index 6cc77dc3f3ff79c49fa7d4ce89360b595995d839..5a8b89a8a46730841b2a863b4b43e5ab8f24650b 100644 (file)
@@ -1404,6 +1404,7 @@ static int pid_revalidate(struct dentry *dentry, struct nameidata *nd)
                } else {
                        inode->i_uid = 0;
                        inode->i_gid = 0;
+                       inode->i_mode = 0;
                }
                security_task_to_inode(task, inode);
                return 1;