summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat/opensolaris/kern
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-05-31 07:02:49 +0000
committerpjd <pjd@FreeBSD.org>2011-05-31 07:02:49 +0000
commitb6ae7ca260605f046bb9ed7abc1beba20f7650a7 (patch)
treeabd41fb961a7db052213bb537207a2c1beb0797c /sys/cddl/compat/opensolaris/kern
parent2adafc03232464837b5248397590e850ab6d7dc7 (diff)
downloadFreeBSD-src-b6ae7ca260605f046bb9ed7abc1beba20f7650a7.zip
FreeBSD-src-b6ae7ca260605f046bb9ed7abc1beba20f7650a7.tar.gz
Imagine situation where a security problem is found in setuid binary.
User upgrades his system to fix the problem, but if he has any ZFS snapshots for the file system which contains problematic binary, any user can mount the snapshot and execute vulnerable binary. Prevent this from happening by always mounting snapshots with setuid turned off. MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/compat/opensolaris/kern')
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
index be9f4ec..a266eca 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c
@@ -172,6 +172,11 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath,
*/
mp->mnt_flag |= MNT_RDONLY;
/*
+ * We don't want snapshots to allow access to vulnerable setuid
+ * programs, so we turn off setuid when mounting snapshots.
+ */
+ mp->mnt_flag |= MNT_NOSUID;
+ /*
* We don't want snapshots to be visible in regular
* mount(8) and df(1) output.
*/
OpenPOWER on IntegriCloud