[PATCH] Call security hook from pid*_revalidate

From: Stephen Smalley
Date: Tue Aug 19 2003 - 16:44:29 EST


On Tue, 2003-08-19 at 04:38, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.0-test3/2.6.0-test3-mm3/

This patch against 2.6.0-test3-mm3 adds calls to the
security_task_to_inode hook to the pid*_revalidate functions to ensure
that the inode security field is also updated appropriately for
/proc/pid inodes. This corresponds with the uid/gid update performed by
the proc-pid-setuid-ownership-fix.patch that is already in -mm3.

fs/proc/base.c | 2 ++
1 files changed, 2 insertions(+)

diff -X /home/sds/dontdiff -ru linux-2.6.0-test3-mm3/fs/proc/base.c linux-2.6.0-test3-mm3-t2i/fs/proc/base.c
--- linux-2.6.0-test3-mm3/fs/proc/base.c 2003-08-19 14:41:23.000000000 -0400
+++ linux-2.6.0-test3-mm3-t2i/fs/proc/base.c 2003-08-19 14:45:49.000000000 -0400
@@ -875,6 +875,7 @@

dentry->d_inode->i_uid = task->euid;
dentry->d_inode->i_gid = task->egid;
+ security_task_to_inode(task, dentry->d_inode);
return 1;
}
d_drop(dentry);
@@ -899,6 +900,7 @@
put_files_struct(files);
dentry->d_inode->i_uid = task->euid;
dentry->d_inode->i_gid = task->egid;
+ security_task_to_inode(task, dentry->d_inode);
return 1;
}
spin_unlock(&files->file_lock);





--
Stephen Smalley <sds@xxxxxxxxxxxxxx>
National Security Agency

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/