Re: [PATCH 00/37] Permit filesystem local caching

2008-02-20 Thread Serge E. Hallyn
Quoting David Howells ([EMAIL PROTECTED]): > > > These patches add local caching for network filesystems such as NFS. > > The patches can roughly be broken down into a number of sets: > > (*) 01-keys-inc-payload.diff > (*) 02-keys-search-keyring.diff > (*) 03-keys-callout-blob.diff > >

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-02-07 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > > Maybe sysctls just need to check capabilities, instead of uids. I > > > > > think that would make a lot of sense anyway. > > > > > > > > Would it be as simple as tagging the inodes with capability sets? One > > > > set for writing, or one eac

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-02-07 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > Maybe sysctls just need to check capabilities, instead of uids. I > > > think that would make a lot of sense anyway. > > > > Would it be as simple as tagging the inodes with capability sets? One > > set for writing, or one each for reading and wr

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-02-06 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > + t->table[0].mode = 0644; > > > > Yikes, this could be a problem for containers, as it's simply tied to > > uid 0, whereas tying it to a capability would let us solve it with > > capability bounds. > > > > This might mean more urgency to get user

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-02-06 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add the following: > > /proc/sys/fs/types/${FS_TYPE}/usermount_safe > > Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> Thanks, Miklos, good explanations in the docs. Acked-by: Serge Hallyn <[EMAIL P

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-01-22 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > What do you think about doing this only if FS_SAFE is also set, > > > > so for instance at first only FUSE would allow itself to be > > > > made user-mountable? > > > > > > > > A safe thing to do, or overly intrusive? > > > > > > It goes somewha

Re: [RFC][PATCH] VFS: create /proc//mountinfo

2008-01-22 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > On Mon, 2008-01-21 at 22:25 +0100, Miklos Szeredi wrote: > > > > You have removed the code that checked if the peer or > > > > master mount was in the same namespace before reporting their > > > > corresponding mount-ids. One d

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-01-22 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > What do you think about doing this only if FS_SAFE is also set, > > so for instance at first only FUSE would allow itself to be > > made user-mountable? > > > > A safe thing to do, or overly intrusive? > > It goes somewhat against the "no policy in

Re: [patch 07/10] unprivileged mounts: add sysctl tunable for "safe" property

2008-01-21 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add the following: > > /proc/sys/fs/types/${FS_TYPE}/usermount_safe > > Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> > --- > > Index: linux/fs/filesystems.c > ==

Re: [patch 09/10] unprivileged mounts: propagation: inherit owner from parent

2008-01-21 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > On mount propagation, let the owner of the clone be inherited from the > parent into which it has been propagated. > > If the parent has the "nosuid" flag, set this flag for the child as > well. This is ne

Re: [patch 08/10] unprivileged mounts: make fuse safe

2008-01-21 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Don't require the "user_id=" and "group_id=" options for unprivileged mounts, > but if they are present, verify them for sanity. > > Disallow the "allow_other" option for unprivileged mounts. > > FUSE was

Re: [TOMOYO #6 retry 02/21] Add struct vfsmount to struct task_struct.

2008-01-16 Thread Serge E. Hallyn
Quoting Kentaro Takeda ([EMAIL PROTECTED]): > Hello. > > Serge E. Hallyn wrote: > > I must say I personally prefer the apparmor approach. > No problem. > > > But I'd recommend > > you get together and get this piece pushed on its own, whichever version

Re: [patch 8/9] unprivileged mounts: propagation: inherit owner from parent

2008-01-15 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > > On mount propagation, let the owner of the clone be inherited from the > > > > > parent into which it has been propagated. Also if the parent has the > > > > > "nosuid" flag, set this flag for the child as well. > > > > > > > > What about node

Re: [patch 8/9] unprivileged mounts: propagation: inherit owner from parent

2008-01-15 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > From: Miklos Szeredi <[EMAIL PROTECTED]> > > > > > > On mount propagation, let the owner of the clone be inherited from the > > > parent into which it has been propagated. Also if the parent has the

Re: [patch 9/9] unprivileged mounts: add "no submounts" flag

2008-01-15 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Why not "nosubmnt"? > > Why not indeed. Maybe I should try to use my brain sometime. Well it really should have 'user' or 'unpriv' in the name somewhere. 'nosubmnt' is more confusing than 'nomnt' because it no submounts really sounds like a reason

Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse mounts

2008-01-15 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Sounds like a sysctl to enable FS_SAFE for fuse will make this patch > > acceptable to everyone? > > I think the most generic approach, is to be able to set "safeness" for > any fs type, not just fuse (Karel's suggestion). > > E.g: > > echo 1 > /

Re: [patch 9/9] unprivileged mounts: add "no submounts" flag

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add a new mount flag "nomnt", which denies submounts for the owner. > This would be useful, if we want to support traditional /etc/fstab > based user mounts. > > In this case mount(8) would still have to be

Re: [patch 7/9] unprivileged mounts: allow unprivileged fuse mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Use FS_SAFE for "fuse" fs type, but not for "fuseblk". > > FUSE was designed from the beginning to be safe for unprivileged users. This > has also been verified in practice over many years. In addition un

Re: [patch 8/9] unprivileged mounts: propagation: inherit owner from parent

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > On mount propagation, let the owner of the clone be inherited from the > parent into which it has been propagated. Also if the parent has the > "nosuid" flag, set this flag for the child as well. What abou

Re: [patch 6/9] unprivileged mounts: allow unprivileged mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Define a new fs flag FS_SAFE, which denotes, that unprivileged mounting of > this filesystem may not constitute a security problem. > > Since most filesystems haven't been designed with unprivileged mountin

Re: [patch 5/9] unprivileged mounts: allow unprivileged bind mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Allow bind mounts to unprivileged users if the following conditions are met: > > - mountpoint is not a symlink > - parent mount is owned by the user > - the number of user mounts is below the maximum

Re: [patch 4/9] unprivileged mounts: propagate error values from clone_mnt

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Allow clone_mnt() to return errors other than ENOMEM. This will be used for > returning a different error value when the number of user mounts goes over the > limit. > > Fix copy_tree() to return EPERM for

Re: [patch 3/9] unprivileged mounts: account user mounts

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add sysctl variables for accounting and limiting the number of user > mounts. > > The maximum number of user mounts is set to 1024 by default. This > won't in itself enable user mounts, setting a mount to

Re: [patch 2/9] unprivileged mounts: allow unprivileged umount

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > The owner doesn't need sysadmin capabilities to call umount(). > > Similar behavior as umount(8) on mounts having "user=UID" option in /etc/mtab. > The difference is that umount also checks /etc/fstab, pres

Re: [patch 1/9] unprivileged mounts: add user mounts to the kernel

2008-01-14 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > This patchset adds support for keeping mount ownership information in the > kernel, and allow unprivileged mount(2) and umount(2) in certain cases. > > The mount owner has the following privileges: > > -

Re: [patch 5/9] unprivileged mounts: allow unprivileged bind mounts

2008-01-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Allow bind mounts to unprivileged users if the following conditions are met: > > - mountpoint is not a symlink > - parent mount is owned by the user > - the number of user mounts is below the maximum

Re: [PATCH][RFC] Simple tamper-proof device filesystem.

2008-01-09 Thread Serge E. Hallyn
Quoting Indan Zupancic ([EMAIL PROTECTED]): > Hello, > > On Wed, January 9, 2008 05:39, Tetsuo Handa wrote: > > Hello. > > > > Indan Zupancic wrote: > >> I think you focus too much on your way of enforcing filename/attributes > >> pairs. > > So? > > So that you miss alternatives and don't see the

Re: [PATCH][RFC] Simple tamper-proof device filesystem.

2007-12-31 Thread Serge E. Hallyn
Quoting Tetsuo Handa ([EMAIL PROTECTED]): > Hello. > > Thank you for attending discussion for previous posting > (starting from http://lkml.org/lkml/2007/12/16/23 ). > > The previous posting was for feasibility test to know > whether this kind of trivial filesystem is acceptable for mainline. >

Re: [PATCH] Pid namespaces vs locks interaction

2007-12-21 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > fcntl(F_GETLK,..) can return pid of process for not current pid namespace (if > process is belonged to the several namespaces). It is true also for pids > in /proc/locks. So correct behavior is saving pointer to the struct pid of > the process lock ow

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-20 Thread Serge E. Hallyn
Quoting Pavel Emelyanov ([EMAIL PROTECTED]): > Oren Laadan wrote: > > > > Serge E. Hallyn wrote: > >> Quoting Pavel Emelyanov ([EMAIL PROTECTED]): > >>> Oren Laadan wrote: > >>>> Serge E. Hallyn wrote: > >>>>> Quoting Oren Laad

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-19 Thread Serge E. Hallyn
Quoting Tetsuo Handa ([EMAIL PROTECTED]): > A brief description about SYAORAN: > > SYAORAN stands for "Simple Yet All-important Object Realizing Abiding > Nexus". SYAORAN is a filesystem for /dev with Mandatory Access Control. I apologize if I'm commiting a faux pas by asking this, but any chan

Re: [RFC/PATCH 2/8] revoke: inode revoke lock V7

2007-12-19 Thread Serge E. Hallyn
Quoting Pekka J Enberg ([EMAIL PROTECTED]): > Hi, > > On Wed, 19 Dec 2007, Serge E. Hallyn wrote: > > > I assume you mean S_REVOKE_LOCK and not ->i_mutex, right? > > > > No I did mean the i_mutex since you take the i_mutex when you set > > S_REVOKE_LOCK.

Re: [RFC/PATCH 2/8] revoke: inode revoke lock V7

2007-12-19 Thread Serge E. Hallyn
Quoting Pekka J Enberg ([EMAIL PROTECTED]): > Hi Serge, > > (Thanks for looking at this. I appreciate the review!) > > On Mon, 17 Dec 2007, [EMAIL PROTECTED] wrote: > > > struct vfsmount *mnt = nd->mnt; > > > - struct dentry *dentry = __d_lookup(nd->dentry, name); > > > + struct dentry *dentry;

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-19 Thread Serge E. Hallyn
Quoting Oren Laadan ([EMAIL PROTECTED]): > > Serge E. Hallyn wrote: > > Quoting Oren Laadan ([EMAIL PROTECTED]): > >> I hate to bring this again, but what if the admin in the container > >> mounts an external file system (eg. nfs, usb, loop mount from a file, &g

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-19 Thread Serge E. Hallyn
Quoting Pavel Emelyanov ([EMAIL PROTECTED]): > Oren Laadan wrote: > > Serge E. Hallyn wrote: > >> Quoting Oren Laadan ([EMAIL PROTECTED]): > >>> I hate to bring this again, but what if the admin in the container > >>> mounts an external file system (eg.

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-17 Thread Serge E. Hallyn
Quoting Oren Laadan ([EMAIL PROTECTED]): > > I hate to bring this again, but what if the admin in the container > mounts an external file system (eg. nfs, usb, loop mount from a file, > or via fuse), and that file system already has a device that we would > like to ban inside that container ? Mik

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-17 Thread Serge E. Hallyn
Quoting Serge E. Hallyn ([EMAIL PROTECTED]): > Quoting Tetsuo Handa ([EMAIL PROTECTED]): > > Hello. > > > > Serge E. Hallyn wrote: > > > CAP_MKNOD will be removed from its capability > > I think it is not enough because the root can rename/unlink device files

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-17 Thread Serge E. Hallyn
Quoting Tetsuo Handa ([EMAIL PROTECTED]): > Hello. > > Serge E. Hallyn wrote: > > CAP_MKNOD will be removed from its capability > I think it is not enough because the root can rename/unlink device files > (mv /dev/sda1 /dev/tmp; mv /dev/sda2 /dev/sda1; mv /dev/tmp /dev/

Re: [patch 1/2] [RFC] Simple tamper-proof device filesystem.

2007-12-17 Thread Serge E. Hallyn
Quoting Tetsuo Handa ([EMAIL PROTECTED]): > A brief description about SYAORAN: > > SYAORAN stands for "Simple Yet All-important Object Realizing Abiding > Nexus". SYAORAN is a filesystem for /dev with Mandatory Access Control. > > /dev needs to be writable, but this means that files on /dev mi

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-13 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > On 12 December 2007 21:42:25 Serge E. Hallyn wrote: > > Ok sorry - by letting this thread sit a few days I lost track of where > > we were. > > > > I see now, so you're saying fl_pid for nfs is not in fact a task pid. >

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-12 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > On 12 December 2007 20:31:15 Serge E. Hallyn wrote: > > Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > > > Hello > > > > > > On 6 December 2007 18:51:30 Serge E. Hallyn wrote: > > > > > fl_pid is use

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-12 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > Hello > > On 6 December 2007 18:51:30 Serge E. Hallyn wrote: > > > fl_pid is used by nfs, fuse and gfs2. For instance nfs keeps in fl_pid > > > some unique id to identify locking process between hosts - it is not a > &g

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-07 Thread Serge E. Hallyn
Quoting J. Bruce Fields ([EMAIL PROTECTED]): > On Thu, Dec 06, 2007 at 03:57:29PM +0300, Vitaliy Gusev wrote: > > I am working on pid namespaces vs locks interaction and want to evaluate > > the > > idea. > > fcntl(F_GETLK,..) can return pid of process for not current pid namespace > > (if > >

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-06 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > On 6 December 2007 17:53:40 Serge E. Hallyn wrote: > > Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > > > Hello! > > > > > > I am working on pid namespaces vs locks interaction and want to evaluate > > > the id

Re: [RFC][PATCH] Pid namespaces vs locks interaction

2007-12-06 Thread Serge E. Hallyn
Quoting Vitaliy Gusev ([EMAIL PROTECTED]): > Hello! > > I am working on pid namespaces vs locks interaction and want to evaluate the > idea. > fcntl(F_GETLK,..) can return pid of process for not current pid namespace (if > process is belonged to the several namespaces). It is true also for pids

Re: [PATCH 2/2] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM

2007-11-01 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > Originally vfs_getxattr would pull the security xattr variable using > the inode getxattr handle and then proceed to clobber it with a subsequent > call > to the LSM. This patch reorders the two operations such that when the xattr > requested is in t

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-11-01 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > This patch modifies the interface to inode_getsecurity to have the function > return a buffer containing the security blob and its length via parameters > instead of relying on the calling function to give it an appropriately sized > buffer. Security

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-26 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > On Fri, 2007-10-26 at 10:02 -0500, Serge E. Hallyn wrote: > > Quoting David P. Quigley ([EMAIL PROTECTED]): > > > On Thu, 2007-10-25 at 19:02 -0500, Serge E. Hallyn wrote: > > > > Quoting David P. Quigley ([EMAIL PROT

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-26 Thread Serge E. Hallyn
Quoting Stephen Smalley ([EMAIL PROTECTED]): > On Fri, 2007-10-26 at 10:02 -0500, Serge E. Hallyn wrote: > > Quoting David P. Quigley ([EMAIL PROTECTED]): > > > On Thu, 2007-10-25 at 19:02 -0500, Serge E. Hallyn wrote: > > > > Quoting David P. Quigley ([EMAIL PROT

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-26 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > On Thu, 2007-10-25 at 19:02 -0500, Serge E. Hallyn wrote: > > Quoting David P. Quigley ([EMAIL PROTECTED]): > > > This patch modifies the interface to inode_getsecurity to have the > > > function return a buffer containin

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-26 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > On Thu, 2007-10-25 at 19:02 -0500, Serge E. Hallyn wrote: > > Quoting David P. Quigley ([EMAIL PROTECTED]): > > > static int task_alloc_security(struct task_struct *task) > > > @@ -2423,14 +2

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-25 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): > This patch modifies the interface to inode_getsecurity to have the > function return a buffer containing the security blob and its length via > parameters instead of relying on the calling function to give it an > appropriately sized buffer. Sec

Re: [PATCH 2/2] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM

2007-10-25 Thread Serge E. Hallyn
Quoting James Morris ([EMAIL PROTECTED]): > On Mon, 22 Oct 2007, David P. Quigley wrote: > > > Originally vfs_getxattr would pull the security xattr variable using > > the inode getxattr handle and then proceed to clobber it with a subsequent > > call > > to the LSM. This patch reorders the two o

Re: [RFC PATCH 4/4] VFS: allow filesystem to override mknod capability checks

2007-08-10 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > From: Miklos Szeredi <[EMAIL PROTECTED]> > > > > > > Add a new filesystem flag, that results in the VFS not checking if the > > > current process has enough privileges to do an mknod(). > > > > > > This is needed on filesystems, where an unprivile

Re: [RFC PATCH 4/4] VFS: allow filesystem to override mknod capability checks

2007-08-09 Thread Serge E. Hallyn
Quoting [EMAIL PROTECTED] ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add a new filesystem flag, that results in the VFS not checking if the > current process has enough privileges to do an mknod(). > > This is needed on filesystems, where an unprivileged user may be able

Re: Adding subroot information to /proc/mounts, or obtaining that through other means

2007-06-21 Thread Serge E. Hallyn
Quoting H. Peter Anvin ([EMAIL PROTECTED]): > Al Viro wrote: > > On Wed, Jun 20, 2007 at 01:57:33PM -0700, H. Peter Anvin wrote: > >> ... or, alternatively, add a subfield to the first field (which would > >> entail escaping whatever separator we choose): > >> > >> /dev/md6 /export ext3 rw,data=ord

Re: [AppArmor 38/45] AppArmor: Module and LSM hooks

2007-06-12 Thread Serge E. Hallyn
Quoting Karl MacMillan ([EMAIL PROTECTED]): > On Tue, 2007-06-12 at 10:34 -0500, Serge E. Hallyn wrote: > > Quoting Stephen Smalley ([EMAIL PROTECTED]): > > [...] > > > > > > > If we added support for named type transitions to SELinux, as proposed >

Re: [AppArmor 38/45] AppArmor: Module and LSM hooks

2007-06-12 Thread Serge E. Hallyn
Quoting Stephen Smalley ([EMAIL PROTECTED]): > On Mon, 2007-06-11 at 14:02 -0500, Serge E. Hallyn wrote: > > Quoting Andreas Gruenbacher ([EMAIL PROTECTED]): > > > On Monday 11 June 2007 16:33, Stephen Smalley wrote: > > > > On Mon, 2007-06-11 at 01:10 +0

Re: [AppArmor 38/45] AppArmor: Module and LSM hooks

2007-06-11 Thread Serge E. Hallyn
Quoting Andreas Gruenbacher ([EMAIL PROTECTED]): > On Monday 11 June 2007 16:33, Stephen Smalley wrote: > > On Mon, 2007-06-11 at 01:10 +0200, Andreas Gruenbacher wrote: > > > On Wednesday 06 June 2007 15:09, Stephen Smalley wrote: > > > > On Mon, 2007-06-04 at 16:30 +0200, Andreas Gruenbacher wrot

Re: [RFC][PATCH 5/14] Introduce union stack

2007-05-23 Thread Serge E. Hallyn
Quoting Paul Dickson ([EMAIL PROTECTED]): > On Mon, 14 May 2007 13:23:06 -0700, Badari Pulavarty wrote: > > > > + while (fs) { > > > + locked = union_trylock(fs->root); > > > + if (!locked) > > > + goto loop1; > > > + locked = union_trylock(fs->altroot); > >

Re: [PATCH 0/2] file capabilities: Introduction

2007-05-17 Thread Serge E. Hallyn
Quoting Suparna Bhattacharya ([EMAIL PROTECTED]): > On Mon, May 14, 2007 at 08:00:11PM +, Pavel Machek wrote: > > Hi! > > > > > "Serge E. Hallyn" <[EMAIL PROTECTED]> wrote: > > > > > > > Following are two patches which have bee

Re: [RFC][PATCH 8/14] Union-mount lookup

2007-05-16 Thread Serge E. Hallyn
Quoting Jan Engelhardt ([EMAIL PROTECTED]): > > On May 16 2007 10:38, Bharata B Rao wrote: > >> > >> >+lookup_union: > >> >+ do { > >> >+ struct vfsmount *mnt = find_mnt(topmost); > >> >+ UM_DEBUG_DCACHE("name=\"%s\", inode=%p, device=%s\n", > >> >+ topmost

Re: [PATCH 2/2] file capabilities: accomodate >32 bit capabilities

2007-05-14 Thread Serge E. Hallyn
Quoting Suparna Bhattacharya ([EMAIL PROTECTED]): > On Thu, May 10, 2007 at 01:01:27PM -0700, Andreas Dilger wrote: > > On May 08, 2007 16:49 -0500, Serge E. Hallyn wrote: > > > Quoting Andreas Dilger ([EMAIL PROTECTED]): > > > > One of the important use cases I c

Re: [PATCH 2/2] file capabilities: accomodate >32 bit capabilities

2007-05-08 Thread Serge E. Hallyn
Quoting Andreas Dilger ([EMAIL PROTECTED]): > On May 08, 2007 14:17 -0500, Serge E. Hallyn wrote: > > As the capability set changes and distributions start tagging > > binaries with capabilities, we would like for running an older > > kernel to not necessarily make th

[PATCH 2/2] file capabilities: accomodate >32 bit capabilities

2007-05-08 Thread Serge E. Hallyn
From: Serge E. Hallyn <[EMAIL PROTECTED]> Subject: [PATCH 2/2] file capabilities: accomodate >32 bit capabilities (Changelog: fixed syntax error in dummy version of check_cap_sanity()) As the capability set changes and distributions start tagging binaries with capabilities, we would

[PATCH 1/2] file capabilities: implement file capabilities

2007-05-08 Thread Serge E. Hallyn
From: Serge E. Hallyn <[EMAIL PROTECTED]> Subject: [PATCH 1/2] file capabilities: implement file capabilities Implement file posix capabilities. This allows programs to be given a subset of root's powers regardless of who runs them, without having to use setuid and giving the bi

[PATCH 0/2] file capabilities: Introduction

2007-05-08 Thread Serge E. Hallyn
Following are two patches which have been sitting for some time in -mm. The first implements file capabilities, the second changes the format a bit to accomodate potential future 64-bit capabilities. We are hoping to get a few more eyes on the code before deciding whether this is safe to finally p

Re: [patch] unprivileged mounts update

2007-04-26 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > So then as far as you're concerned, the patches which were in -mm will > > > > remain unchanged? > > > > > > Basically yes. I've merged the update patch, which was not yet added > > > to -mm, did so

Re: [patch] unprivileged mounts update

2007-04-26 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > So then as far as you're concerned, the patches which were in -mm will > > remain unchanged? > > Basically yes. I've merged the update patch, which was not yet added > to -mm, did some cosmetic code changes, and updated the patch headers. > > There'

Re: [patch] unprivileged mounts update

2007-04-26 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > Right, I figure if the normal action is to always do > > > > mnt->user = current->fsuid, then for the special case we > > > > pass a uid in someplace. Of course... do we not have a > > > > place to

Re: [patch] unprivileged mounts update

2007-04-26 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Right, I figure if the normal action is to always do > > mnt->user = current->fsuid, then for the special case we > > pass a uid in someplace. Of course... do we not have a > > place to do that? Would it be a no-no to use 'data' for > > a non-fs-sp

Re: [patch] unprivileged mounts update

2007-04-25 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > > > Quoting Eric W. Biederman ([EMAIL PROTECTED]): > >> > >> Are there other permission checks that mount is doing that we > >> care about. >

Re: [patch] unprivileged mounts update

2007-04-25 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > > > Quoting H. Peter Anvin ([EMAIL PROTECTED]): > >> Miklos Szeredi wrote: > >> > > >> > Andrew, please skip this patch, for now.

Re: [patch] unprivileged mounts update

2007-04-25 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > Miklos Szeredi <[EMAIL PROTECTED]> writes: > > >> From: Miklos Szeredi <[EMAIL PROTECTED]> > >> > >> - refine adding "nosuid" and "nodev" flags for unprivileged mounts: > >> o add "nosuid", only if mounter doesn't have CAP_SETUID capability > >

Re: [patch] unprivileged mounts update

2007-04-25 Thread Serge E. Hallyn
Quoting H. Peter Anvin ([EMAIL PROTECTED]): > Miklos Szeredi wrote: > > > > Andrew, please skip this patch, for now. > > > > Serge found a problem with the fsuid approach: setfsuid(nonzero) will > > remove filesystem related capabilities. So even if root is trying to > > set the "user=UID" flag

Re: [patch 0/8] mount ownership and unprivileged mount syscall (v4)

2007-04-20 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > This patchset has now been bared to the "lowest common denominator" > that everybody can agree on. Or at least there weren't any objections > to this proposal. > > Andrew, please consider it for -mm. > > Thanks, > Miklos > > > v3 -> v4: > > -

Re: [RFC][PATCH 5/15] Introduce union stack

2007-04-17 Thread Serge E. Hallyn
Quoting Bharata B Rao ([EMAIL PROTECTED]): > From: Jan Blunck <[EMAIL PROTECTED]> > Subject: Introduce union stack. > > Adds union stack infrastructure to the dentry structure and provides > locking routines to walk the union stack. > > Signed-off-by: Jan Blunck <[EMAIL PROTECTED]> > Signed-off-b

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > I'm a bit lost about what is currently done and who advocates for what. > > > > It seems to me the MNT_ALLOWUSERMNT (or whatever :) flag should be > > propagated. In the /share rbind+chroot example, I assume the admin > > would start by doing > > >

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > > > Also for bind-mount and remount operations the flag has to be > > > > > > propagated > > > > > > down its propagation tree. Otherwise a unpriviledged mount in a > > > > > > shared > > > > > > mount wont get reflected in its peers and slaves

Re: [patch 05/10] Add "permit user submounts" flag to vfsmount

2007-04-17 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > MNT_USER and MNT_USERMNT? I claim no way will people keep those > > > > straight. How about MNT_ALLOWUSER and MNT_USER? > > > > > > Umm, is "allowuser" more clear than "usermnt"? What is allowed to the > > > > I think so, yes. One makes it c

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > >> > >> Why are directory permissions not sufficient to allow/deny non-priveleged > > mounts? > >> I don't understand that contention yet. >

Re: [patch 05/10] Add "permit user submounts" flag to vfsmount

2007-04-17 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > From: Miklos Szeredi <[EMAIL PROTECTED]> > > > > > > If MNT_USERMNT flag is not set in the target vfsmount, then > > > > MNT_USER and MNT_USERMNT? I claim no way will people keep those > > straight. How about MNT_ALLOWUSER and MNT_USER? > > Umm

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-17 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > "Serge E. Hallyn" <[EMAIL PROTECTED]> writes: > >> > >> Why are directory permissions not sufficient to allow/deny non-priveleged > > mounts? > >> I don't understand that contention yet. >

Re: [Devel] Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-16 Thread Serge E. Hallyn
Quoting Eric W. Biederman ([EMAIL PROTECTED]): > Miklos Szeredi <[EMAIL PROTECTED]> writes: > > >> > That depends. Current patches check the "unprivileged submounts > >> > allowed under this mount" flag only on the requested mount and not on > >> > the propagated mounts. Do you see a problem wit

Re: [patch 05/10] Add "permit user submounts" flag to vfsmount

2007-04-16 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > If MNT_USERMNT flag is not set in the target vfsmount, then MNT_USER and MNT_USERMNT? I claim no way will people keep those straight. How about MNT_ALLOWUSER and MNT_USER? -serge > unprivileged mounts w

Re: How to query mount propagation state?

2007-04-16 Thread Serge E. Hallyn
Quoting Ram Pai ([EMAIL PROTECTED]): > On Mon, 2007-04-16 at 12:34 +0200, Miklos Szeredi wrote: > > Currently one of the difficulties with mount propagations is that > > there's no way to know the current state of the propagation tree. > > > > Has anyone thought about how this info could be querie

Re: [patch 0/8] unprivileged mount syscall

2007-04-15 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > Agreed on desired behavior, but not on chroot sufficing. It actually > > > > sounds like you want exactly what was outlined in the OLS paper. > > > > > > > > Users still need to be in a different mounts namespace from the admin > > > > user so l

Re: [patch 0/8] unprivileged mount syscall

2007-04-13 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > Thinking a bit more about this, I'm quite sure most users wouldn't > > > even want private namespaces. It would be enough to > > > > > > chroot /share/$USER > > > > > > and be done with it. > > > > > > Private namespaces are only good for keep

Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-13 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Given the existence of shared subtrees allowing/denying this at the mount > > namespace level is silly and wrong. > > > > If we need more than just the filesystem permission checks can we > > make it a mount flag settable with mount and remount that

Re: [patch 0/8] unprivileged mount syscall

2007-04-13 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > On Wed, 2007-04-11 at 12:44 +0200, Miklos Szeredi wrote: > > > > 1. clone the master namespace. > > > > > > > > 2. in the new namespace > > > > > > > > move the tree under /share/$me to / > > > > for each ($user, $what, $how) { > > >

Re: [patch 05/10] add "permit user mounts in new namespace" clone flag

2007-04-12 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > From: Miklos Szeredi <[EMAIL PROTECTED]> > > If CLONE_NEWNS and CLONE_NEWNS_USERMNT are given to clone(2) or > unshare(2), then allow user mounts within the new namespace. > > This is not flexible enough, because user mounts can't be enabled for > the

Re: [patch 0/8] unprivileged mount syscall

2007-04-11 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > Not objecting to prctl(), but two other options would be > > > > 1. add a CLONE_NEW_NS_USERMNT flag - kind of ugly, but that is > >the time at which the ns is created, so in that sense it > >makes sense. > > Yes, I thought about

Re: [patch 0/8] unprivileged mount syscall

2007-04-11 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > It would be nice in general if we could avoid any sort of checks for > > (mnt->mnt_ns == init_nsproxy.mnt_ns). Maybe that won't be possible, > > but, taking the two listed examples: > > [snip] > > It's probably worthwile going after these problemat

Re: [patch 0/8] unprivileged mount syscall

2007-04-11 Thread Serge E. Hallyn
Quoting Ian Kent ([EMAIL PROTECTED]): > On Wed, 2007-04-11 at 09:26 -0500, Serge E. Hallyn wrote: > > Quoting Ian Kent ([EMAIL PROTECTED]): > > > On Wed, 2007-04-11 at 12:48 +0200, Miklos Szeredi wrote: > > > > > > >> > > > > > > >>

Re: [patch 0/8] unprivileged mount syscall

2007-04-11 Thread Serge E. Hallyn
Quoting Ian Kent ([EMAIL PROTECTED]): > On Wed, 2007-04-11 at 12:48 +0200, Miklos Szeredi wrote: > > > > >> > > > > >> - users can use bind mounts without having to pre-configure them in > > > > >> /etc/fstab > > > > >> > > > > > > > > This is by far the biggest concern I see. I think the secur

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > This patchset adds support for keeping mount ownership information in > the kernel, and allow unprivileged mount(2) and umount(2) in certain > cases. Well, I'd like to feel all smart and point out some bugs, but the code all reads very nicely, seems to

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > One thing that is missing from this series is the ability to restrict > > > user mounts to private namespaces. The reason is that private > > > namespaces have still not gained the momentum and support needed for > > > painless user experience. So

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > This patchset adds support for keeping mount ownership information in > the kernel, and allow unprivileged mount(2) and umount(2) in certain > cases. > > This can be useful for the following reasons: > > - mount(8) can store ownership ("user=XY" optio

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > > > One thing that is missing from this series is the ability to restrict > > > > > user mounts to private namespaces. The reason is that private > > > > > namespaces have still not gained the momentum and support needed for > > > > > painless user

Re: [patch 0/8] unprivileged mount syscall

2007-04-09 Thread Serge E. Hallyn
Quoting Miklos Szeredi ([EMAIL PROTECTED]): > > > This patchset adds support for keeping mount ownership information in > > > the kernel, and allow unprivileged mount(2) and umount(2) in certain > > > cases. > > > > No replies, huh? > > All we need is a comment from Andrew, and the replies come f

  1   2   >