]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/open.c
LSM: Add security_path_chroot().
[net-next-2.6.git] / fs / open.c
index b5c294d35bd138378d98daff1ac569088c40cc0c..201041dfca5758207fa2491bb0055079d335e747 100644 (file)
--- 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;