Bug 115361 - [zfs] "zfs get setuid" doesn't reflect setuid state as set by "zfs mount"
Summary: [zfs] "zfs get setuid" doesn't reflect setuid state as set by "zfs mount"
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 7.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-09 20:00 UTC by Scot Hetzel
Modified: 2020-08-15 05:58 UTC (History)
1 user (show)

See Also:


Attachments
zfstest (6.55 KB, text/plain)
2007-08-23 20:41 UTC, Scot Hetzel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2007-08-09 20:00:13 UTC
When using mount to change the mount point options to noatime,noexec,nosuid it will make the change on the mount point.  Using zfs get, it will show that atime, and exec are off, but setuid is still on.  But then you are unable to unset these options with mount.  The atime, noexec, setuid properties can be changed by using either zfs inherit or zfs set.  After you have reset them to their defaults, mount will no longer allow these settings to be changed.  The only way to set them with mount is to umount the filesystem and remount it.

How-To-Repeat: hp010# umount /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default

hp010# zfs mount -a
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

hp010# mount -u -o noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

Why doesn't the setuid property change to 'temporary' for
rootpool/usr/ports/distfiles?

hp010# mount -u -o exec,suid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

mount can't get rid of these options.

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noatime, noexec, nosuid)

hp010# mount -u -o atime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noatime, noexec, nosuid)

Same problem with getting rid of noatime.  I would have expected mount
to be able to be able to change the zfs properties of atime, exec back
to on.

hp010# zfs inherit -r atime rootpool/usr/ports/distfiles
hp010# zfs inherit -r exec rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)


hp010# zfs set setuid=off rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    off                           local
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

We have now set everything back to the default mount options using 'zfs inherit'

hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Now mount can't set noatime or noexec.

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Back to the defaults again.

This last part gets a bit strange, without umounting
/usr/ports/distfiles, I tried the following:

hp010# mount -u -o nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)
hp010# zfs set setuid=off rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    off                           local
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)
hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)
hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs inherit -r exec rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o noatime,noexec,nosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      off                           temporary
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local,
noexec, nosuid)

It won't set noatime when noexec and nosuid are specified.

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Now it removed noexec, and didn't set noatime.

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Lets try setting noatime again:

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

mount shows nosuid.  Lets unset if with zfs inherit:

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

nosuid is gone, lets see if we can now set noatime:

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Again mount is showing nosuid:

hp010# mount -u -o nonoatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)
hp010# mount -u -o nonosuid /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, nosuid)

Try nonoatime and nonosuid, but mount still showing nosuid.  Using zfs
inherit gets rid of nosuid:

hp010# zfs inherit -r setuid rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Give up, and umount the filesystem:

hp010# umount /usr/ports/distfiles
hp010# zfs mount -a
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime)

We can now set noatime, try nonoatime to unset it:

hp010# mount -u -o nonoatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime)

That didn't work, does atime work:

hp010# mount -u -o atime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     off                           temporary
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, noatime)

Reset atime to defaults with zfs inherit:

hp010# zfs inherit -r atime rootpool/usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

Does nonoatime have any side efects now:

hp010# mount -u -o nonoatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)

No side effect, lets try setting noatime:

hp010# mount -u -o noatime /usr/ports/distfiles
hp010# zfs get atime,exec,setuid rootpool/usr/ports/distfiles ; mount
| grep distfiles
NAME                          PROPERTY  VALUE                         SOURCE
rootpool/usr/ports/distfiles  atime     on                            default
rootpool/usr/ports/distfiles  exec      on                            default
rootpool/usr/ports/distfiles  setuid    on                            default
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010#

Now mount can't set noatime.
Comment 1 Pawel Jakub Dawidek freebsd_committer freebsd_triage 2007-08-10 07:34:01 UTC
Responsible Changed
From-To: freebsd-bugs->pjd

I'll take this one.
Comment 2 Scot Hetzel 2007-08-23 20:41:29 UTC
Attached is a test program for setting/unsetting ZFS mount options via mount.

Scot

-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.
Comment 3 Scot Hetzel 2007-08-24 07:40:19 UTC
On 8/23/07, Scot Hetzel <swhetzel@gmail.com> wrote:
> Attached is a test program for setting/unsetting ZFS mount options via
> mount.
>
The zfstest program runs the failure case that is shown in this PR, as
well as testing the following mount options:

ZFS
PROPERTY               MOUNT OPTION
atime                      atime, noatime, nononatime
exec                       exec, noexec, nonoexec
readonly                 rw, ro, noro
setuid                     setuid, nosetuid
xattr (1)                  xattr, noxattr

devices (2)              devices, nodevices
devices,setuid (3)    suid, nosuid, nonosuid

1. waiting to be implemented in FreeBSD ZFS
2. not used for FreeBSD ZFS due to devfs (?)
3. according to zfs(1M) nosuid option is an alias for
"nodevices,nosetuid", FreeBSD ZFS only turns setuid off when nosuid is
specified. devices is not turned off due to devfs (?)

I did find another problem, if you use the rw mount option, it mounts
the filesystem read-only.

hp010# mount -u -o ro /usr/ports/distfiles ; mount | grep dist
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local)
hp010# mount -u -o rw /usr/ports/distfiles ; mount | grep dist
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, read-only)
hp010# mount -u -o ro /usr/ports/distfiles ; mount | grep dist
rootpool/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, read-only)

Scot
-- 
DISCLAIMER:
No electrons were mamed while sending this message. Only slightly bruised.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2009-05-28 23:20:10 UTC
Responsible Changed
From-To: pjd->freebsd-fs

With pjd's permission, reassing ZFS-related PRs to freebsd-fs.
Comment 5 Martin Matuska freebsd_committer freebsd_triage 2011-10-11 08:23:27 UTC
If there are no objections, I would like to close this PR.

-- 
Martin Matuska
FreeBSD committer
http://blog.vx.sk
Comment 6 Scot Hetzel 2013-11-09 17:45:46 UTC
On Tue, Oct 11, 2011 at 2:23 AM, Martin Matuska <mm@freebsd.org> wrote:
> If there are no objections, I would like to close this PR.
>
> --
> Martin Matuska
> FreeBSD committer
> http://blog.vx.sk
>

I just ran the zfstest script on:

FreeBSD fbsd10 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r257220: Sun Oct
27 22:42:08 CDT 2013     root@fbsd10:/usr/obj/usr/src/sys/GENERIC
i386

The results below shows that mount still can't change devices, setuid
or xattr attributes on the zfs filesystem (zfs get
devices,setuid,xattr ${ZFS_FILESYSTEM}).  they should show as off, and
 SOURCE should change to temporary, but they stay at default.

NOTE: change ZFS_FILESYSTEM and ZFS_MOUNTPOINT in the zfstest script
to the appropriate zfs filesystem and mount point.

================================================================================

Test setting/unsetting of devices

===> Current settings for Scratch/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, local, nfsv4acls)

===> mount -u -o nodevices /usr/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default <- should be off
and temporary
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls) <- missing nodevices

===> mount -u -o devices /usr/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls)

================================================================================

Test setting/unsetting of setuid
===> Current settings for Scratch/ports/distfiles
NAME                     PROPERTY  VALUE   SOURCE
Scratch/ports/distfiles  setuid    on      default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, local, nfsv4acls)

===> mount -u -o nosetuid /usr/ports/distfiles
NAME                     PROPERTY  VALUE   SOURCE
Scratch/ports/distfiles  setuid    on      default <- should be off
and temporary
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nosuid, nfsv4acls)

===> mount -u -o setuid /usr/ports/distfiles
NAME                     PROPERTY  VALUE   SOURCE
Scratch/ports/distfiles  setuid    on      default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls)

================================================================================

Test setting/unsetting of suid
===> Current settings for Scratch/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default
Scratch/ports/distfiles  setuid    on       default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, local, nfsv4acls)

===> mount -u -o nosuid /usr/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default <- should be off
and temporary
Scratch/ports/distfiles  setuid    on       default  <- should be off
and temporary
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nosuid, nfsv4acls) <- missing nodevices

===> mount -u -o nonosuid /usr/ports/distfiles
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default
Scratch/ports/distfiles  setuid    on       default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls)

===> mount -u -o suid /usr/ports/distfiles
=====> nosuid already set
NAME                     PROPERTY  VALUE    SOURCE
Scratch/ports/distfiles  devices   on       default
Scratch/ports/distfiles  setuid    on       default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls)

================================================================================

Test setting/unsetting of xattr
===> Current settings for Scratch/ports/distfiles
NAME                     PROPERTY  VALUE  SOURCE
Scratch/ports/distfiles  xattr     off    temporary
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, local, nfsv4acls)

===> mount -u -o noxattr /usr/ports/distfiles
NAME                     PROPERTY  VALUE  SOURCE
Scratch/ports/distfiles  xattr     off    temporary
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls) <- missing noxattr

===> mount -u -o xattr /usr/ports/distfiles
NAME                     PROPERTY  VALUE  SOURCE
Scratch/ports/distfiles  xattr     off    temporary <- should be on and default
Scratch/ports/distfiles on /usr/ports/distfiles (zfs, NFS exported,
local, nfsv4acls)

================================================================================

-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.
Comment 7 Alan Somers freebsd_committer freebsd_triage 2018-02-20 16:26:04 UTC
Most of this bug has apparently been fixed.  "zfs mount" can now turn exec, atime, and rw back on.  And there are no plans to implement the devices or xattr properties.  So the only part of this bug report that still applies is that the setuid option can't be changed by a remount.  I'll retitle the bug appropriately.
Comment 8 Alan Somers freebsd_committer freebsd_triage 2018-02-20 16:30:28 UTC
It seems that
Comment 9 Alan Somers freebsd_committer freebsd_triage 2018-02-20 16:34:19 UTC
To restate the bug:

"zfs mount -o update,setuid <FILESYSTEM>" works, but "zfs get setuid <FILESYSTEM>" doesn't reflect the new state of the mount option.  Steps to reproduce:

$ sudo zpool create foo da1
$ sudo zfs create foo/fs
$ sudo cp -a /sbin/ping /foo/fs
$ zfs get setuid foo/fs
NAME    PROPERTY  VALUE   SOURCE
foo/fs  setuid    on      default
$ mount | grep foo.fs
foo/fs on /foo/fs (zfs, local, nfsv4acls)
$ /foo/fs/ping -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=55 time=3.419 ms

--- 8.8.8.8 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 3.419/3.419/3.419/0.000 ms
$ sudo zfs mount -o update,nosetuid foo/fs
$ mount | grep foo.fs
foo/fs on /foo/fs (zfs, local, nosuid, nfsv4acls)
# XXX "zfs get" will return the wrong value
$ zfs get setuid foo/fs
NAME    PROPERTY  VALUE   SOURCE
foo/fs  setuid    on      default
$ /foo/fs/ping -c 1 8.8.8.8
ping: ssend socket: Operation not permitted

In the above transcript, the output of "mount" matches what is expected, as does the behavior of ping (which requires setuid to run).  Only the output of "zfs get" is wrong.
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-02-20 18:43:09 UTC
A commit references this bug:

Author: asomers
Date: Tue Feb 20 18:42:09 UTC 2018
New revision: 329652
URL: https://svnweb.freebsd.org/changeset/base/329652

Log:
  Update ZFS tests now that PR 221985 is fixed

  tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_003_pos.ksh
  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  	Convert Illumos syntax => FreeBSD syntax

  tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh
  	Clear expected failure for zfs_get_003_pos

  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  	Remove the "devices" property.  Unlike on Illumos, on FreeBSD it
  	can't be changed temporarily (or at all).

  tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
  	Remove the expected failure for zfs_mount_007_pos due to 221985, but
  	add a new expected failure due to PR 115361.

  PR:		221985
  PR:		115361
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_003_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_get/zfs_get_test.sh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_007_pos.ksh
  projects/zfsd/head/tests/sys/cddl/zfs/tests/cli_root/zfs_mount/zfs_mount_test.sh
Comment 11 Mark Linimon freebsd_committer freebsd_triage 2020-08-15 05:58:17 UTC
Committed Tue Feb 20 18:42:09 UTC 2018 as r329652.

^Triage: assign to committer that resolved.