From: Mark Huang Date: Tue, 23 Nov 2004 15:15:05 +0000 (+0000) Subject: PL3131 fix: prevent vservers from escaping chroot() barriers X-Git-Tag: before-enable-kexec-patch~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0b993f80d64e6868f55c852ca79f3fef4aaa9246;p=linux-2.6.git PL3131 fix: prevent vservers from escaping chroot() barriers --- diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index cc26948d5..e89cb306c 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "xattr.h" #include "acl.h" @@ -296,6 +297,9 @@ ext3_permission(struct inode *inode, int mask, struct nameidata *nd) { int mode = inode->i_mode; + /* Prevent vservers from escaping chroot() barriers */ + if (IS_BARRIER(inode) && !vx_check(0, VX_ADMIN)) + return -EACCES; /* Nobody gets write access to a read-only fs */ if ((mask & MAY_WRITE) && (IS_RDONLY(inode) || (nd && nd->mnt && MNT_IS_RDONLY(nd->mnt))) &&