--- patch-2.6.30.1-vs2.3.0.36.14-pre4.diff 2009-07-23 17:00:41.000000000 +0200 +++ patch-2.6.30-debian-vs2.3.0.36.14-idiap.diff 2009-07-23 17:44:55.000000000 +0200 @@ -6752,55 +6752,41 @@ diff -NurpP --minimal linux-2.6.30.1/fs/super.c linux-2.6.30.1-vs2.3.0.36.14-pre4/fs/super.c --- linux-2.6.30.1/fs/super.c 2009-06-11 17:13:08.000000000 +0200 +++ linux-2.6.30.1-vs2.3.0.36.14-pre4/fs/super.c 2009-07-04 01:11:39.000000000 +0200 -@@ -39,6 +39,9 @@ +@@ -39,6 +39,7 @@ #include #include #include -+#include -+#include +#include #include #include "internal.h" -@@ -992,12 +995,18 @@ struct vfsmount * - vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data) - { - struct vfsmount *mnt; -+ struct super_block *sb; - char *secdata = NULL; - int error; - - if (!type) - return ERR_PTR(-ENODEV); - -+ error = -EPERM; -+ if ((type->fs_flags & FS_BINARY_MOUNTDATA) && -+ !vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT)) -+ goto out; -+ - error = -ENOMEM; - mnt = alloc_vfsmnt(name); - if (!mnt) -@@ -1016,9 +1025,17 @@ vfs_kern_mount(struct file_system_type * - error = type->get_sb(type, flags, name, data, mnt); - if (error < 0) +@@ -1018,7 +1019,13 @@ vfs_kern_mount(struct file_system_type * goto out_free_secdata; -- BUG_ON(!mnt->mnt_sb); + BUG_ON(!mnt->mnt_sb); - error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata); -+ sb = mnt->mnt_sb; -+ BUG_ON(!sb); -+ + error = -EPERM; -+ if (!vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT) && !sb->s_bdev && -+ (sb->s_magic != PROC_SUPER_MAGIC) && -+ (sb->s_magic != DEVPTS_SUPER_MAGIC)) ++ if (!vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT) && ++ (type->fs_flags & FS_REQUIRES_DEV) && ++ !mnt->mnt_sb->s_bdev) + goto out_sb; + -+ error = security_sb_kern_mount(sb, flags, secdata); ++ error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata); if (error) goto out_sb; +@@ -1070,6 +1077,11 @@ do_kern_mount(const char *fstype, int fl + struct vfsmount *mnt; + if (!type) + return ERR_PTR(-ENODEV); ++ ++ if ((type->fs_flags & FS_BINARY_MOUNTDATA) && ++ !vx_capable(CAP_SYS_ADMIN, VXC_BINARY_MOUNT)) ++ return ERR_PTR(-EPERM); ++ + mnt = vfs_kern_mount(type, flags, name, data); + if (!IS_ERR(mnt) && (type->fs_flags & FS_HAS_SUBTYPE) && + !mnt->mnt_sb->s_subtype) diff -NurpP --minimal linux-2.6.30.1/fs/sysfs/mount.c linux-2.6.30.1-vs2.3.0.36.14-pre4/fs/sysfs/mount.c --- linux-2.6.30.1/fs/sysfs/mount.c 2009-06-11 17:13:08.000000000 +0200 +++ linux-2.6.30.1-vs2.3.0.36.14-pre4/fs/sysfs/mount.c 2009-07-04 01:11:39.000000000 +0200 @@ -24578,8 +24564,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 30 --EXTRAVERSION = .1 -+EXTRAVERSION = .1-vs2.3.0.36.14-pre4 +-EXTRAVERSION = ++EXTRAVERSION = -vs2.3.0.36.14-idiap NAME = Man-Eating Seals of Antiquity # *DOCUMENTATION*