Re: [PATCH] jail mount/unmount patch

2011-07-28 Thread Martin Matuska
For vfs_mount, the easiest way to look at this is to follow the path of the "realfspath" argument. It goes to vfs_domount_first() and ends up in vfs_mount_alloc() where is the only place it is consumed: strlcpy(mp->mnt_stat.f_mntonname, fspath, MNAMELEN); The original fspath (not realfspath) is co

Re: [PATCH] jail mount/unmount patch

2011-07-28 Thread Jamie Gritton
There's a curious asymmetry here: enforce_statfs==1 is checked for munging the name on unmounting, but not on mounting. I see the point on the unmount side, as statfs would give the full un-jailed pathname and an admin would naturally want to unmount what he sees mounted, but without the same logi

[PATCH] jail mount/unmount patch

2011-07-28 Thread Martin Matuska
Please review my attached patch. The patch fixes f_mntonname with mount/unmount inside a jail with allow.mount enabled. Filesystems mountable in a jail require the VFCF_JAIL flag (currently only ZFS). With this patch, mount and unmount works both with enforce_statfs = 0 and enforce_statfs = 1.