mirror_zfs/tests/zfs-tests/include
Brian Behlendorf d34d4f97a8
snapdir: add 'disabled' value to make .zfs inaccessible
In some environments, just making the .zfs control dir hidden from sight
might not be enough. In particular, the following scenarios might
warrant not allowing access at all:
- old snapshots with wrong permissions/ownership
- old snapshots with exploitable setuid/setgid binaries
- old snapshots with sensitive contents

Introducing a new 'disabled' value that not only hides the control dir,
but prevents access to its contents by returning ENOENT solves all of
the above.

The new property value takes advantage of 'iuv' semantics ("ignore
unknown value") to automatically fall back to the old default value when
a pool is accessed by an older version of ZFS that doesn't yet know
about 'disabled' semantics.

I think that technically the zfs_dirlook change is enough to prevent
access, but preventing lookups and dir entries in an already opened .zfs
handle might also be a good idea to prevent races when modifying the
property at runtime.

Add zfs_snapshot_no_setuid parameter to control whether automatically
mounted snapshots have the setuid mount option set or not.

this could be considered a partial fix for one of the scenarios
mentioned in desired.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Co-authored-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Closes #3963
Closes #16587
2024-10-02 09:12:02 -07:00
..
.gitignore Add zpool events tests 2017-05-22 12:34:42 -04:00
blkdev.shlib ZTS: get_persistent_disk_name can return truncated names 2023-11-29 09:34:29 -08:00
commands.cfg ZTS: Replace MD5 and SHA256 wit XXH128 2024-09-28 09:24:05 -07:00
default.cfg.in Allowing PERFPOOL to be defined by zfs-test users 2024-02-09 10:02:46 -08:00
libtest.shlib ZTS: Replace MD5 and SHA256 wit XXH128 2024-09-28 09:24:05 -07:00
math.shlib Block cloning tests. 2023-12-26 12:01:53 -08:00
properties.shlib snapdir: add 'disabled' value to make .zfs inaccessible 2024-10-02 09:12:02 -07:00
tunables.cfg Adding Direct IO Support 2024-09-14 13:47:59 -07:00
zpool_script.shlib tests: review every awk(1) invocation 2022-04-01 17:57:55 -07:00