summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorTetsuo Handa2009-10-04 14:49:48 +0200
committerJames Morris2009-10-12 01:56:02 +0200
commit8b8efb44033c7e86b3dc76f825c693ec92ae30e9 (patch)
tree8cf43afc59f88f36a86f3a8165770bccec28b3c3 /fs/open.c
parentLSM: Add security_path_chmod() and security_path_chown(). (diff)
downloadkernel-qcow2-linux-8b8efb44033c7e86b3dc76f825c693ec92ae30e9.tar.gz
kernel-qcow2-linux-8b8efb44033c7e86b3dc76f825c693ec92ae30e9.tar.xz
kernel-qcow2-linux-8b8efb44033c7e86b3dc76f825c693ec92ae30e9.zip
LSM: Add security_path_chroot().
This patch allows pathname based LSM modules to check chroot() operations. This hook is used by TOMOYO. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/open.c b/fs/open.c
index b5c294d35bd1..201041dfca57 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -587,6 +587,9 @@ SYSCALL_DEFINE1(chroot, const char __user *, filename)
error = -EPERM;
if (!capable(CAP_SYS_CHROOT))
goto dput_and_out;
+ error = security_path_chroot(&path);
+ if (error)
+ goto dput_and_out;
set_fs_root(current->fs, &path);
error = 0;