🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.netbsd.tech.kern
7 messages
7 total messages Started by od2uvb Mon, 02 Nov 2026 12:49
OpenZFS on NetBSD
#15
Author: od2uvb
Date: Mon, 02 Nov 2026 12:49
53 lines
3923 bytes
Hello,

Showta Ishizaki's message made me aware that someone is working on Subj.

This might be a suitable occasion to mention a logically very simple
and at the same time very useful, but faulty/missing feature in ZFS.

For years I have been confronted with broken semantics of access control
lists on ZFS. The problem is that there is no aclmode which would
decouple them from the Unix mode bits.

The problem becomes apparent as soon as you for example try to use ZFS for
"group areas" where multiple persons shall have read and write access
rights. As soon as some participant does a chmod (even inadvertently,
when some software does this without asking), the ACLs break. This is
impossible to prevent.

The only workaround is running scheduled fix-up scripts, combing the file
trees and restoring the ACLs.

This issue has been discussed on the zfs-devel mailing list at least once
(in July 2018) but without any outcome.

Paul B. Henson seemed to have suggested something more or less similar even
5 years earlier, in 2013:
> https://illumos.org/issues/3571

Note the line "Currently I have to intervene frequently to reset the ACL."

This is what is being done on ZFS installations I know, except the ones
who for this very reason had to resign from using the ACLs.

It is a pity that for over a decade nothing has changed to make ACLs
consistently working and generally usable.

I have looked at the OpenZFS code, both for Linux and FreeBSD and
unfortunately it is built around the kernel's interpretation of mode
bits. In other words, a lightweight patch to add a "decoupled acl" mode
does not look feasible, the logic of privilege evaluation has to be
refactored to make it possible.

It would very useful if NetBSD could apply such refactoring and offer
practically useful, not crippled ACLs.

Could this (an aclmode where privilege evaluation fully ignores mode
bits) be considered for the port apparently being in the works?

Cheers,
od2uvb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#16
Author: od2uvb
Date: Wed, 04 Nov 2026 10:52
24 lines
3012 bytes
On Mon, Nov 02, 2026 at 01:49:23PM +0100, od2uvb@0w.se wrote:
> This issue has been discussed on the zfs-devel mailing list at least once
> (in July 2018)

https://zfsonlinux.topicbox.com/groups/zfs-devel/T82e4ca6ba5be23dd/zfs-devel-acls-usability-was-re-native-zfs-nfs4-acl-support-issue-4966

Please check the system administrator view there. Otherwise it looks
like the worlds of zfs-developers and system administrators had been
isolated from each other.

The zfs acl functionality has remained woefully inadequate for decades, on
all platforms. NetBSD has a chance to do it right (and fully compatible,
if the other aclmodes are made available). The "aclmode=decoupled"
is presumably also the easiest mode to implement and debug first.

The interaction between acls and "owner"/"group"-based rights evaluation
is in the platform-specific ZFS code. This presents an opportunity to
avoid importing the enforced conflation from Linux and FreeBSD.

/od2uvb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#17
Author: zakinko
Date: Wed, 04 Nov 2026 11:53
51 lines
5543 bytes
Thank you for both mails, and for the pointer to the 2018 thread,
which I have now read through.

I had first tried an aclmode=ignore, and that turned out to be the
ignored no-op the thread warns about. I then rewrote it the way the
thread describes as aclmode=decoupled, but I have not tested that yet,
and I have come to wonder whether it is a good direction. With it the
mode no longer matches the ACL, and POSIX (XBD 4.7) and RFC 8881
section 6.4 both ask that the two be kept in step, so it could be a
hard one to get accepted.

Before going further I would like to see how far the existing
aclmode=passthrough can go. It keeps ACEs for named users and groups
across chmod and only rewrites owner@, group@ and everyone@, so a
share whose rights are all in named groups may behave well already,
although everyone@ needs some care. I will try this and write again
with what I find.

-- 
zakinko

2026年11月4日(水) 19:52 <od2uvb@0w.se>:
>
> On Mon, Nov 02, 2026 at 01:49:23PM +0100, od2uvb@0w.se wrote:
> > This issue has been discussed on the zfs-devel mailing list at least once
> > (in July 2018)
>
> https://zfsonlinux.topicbox.com/groups/zfs-devel/T82e4ca6ba5be23dd/zfs-devel-acls-usability-was-re-native-zfs-nfs4-acl-support-issue-4966
>
> Please check the system administrator view there. Otherwise it looks
> like the worlds of zfs-developers and system administrators had been
> isolated from each other.
>
> The zfs acl functionality has remained woefully inadequate for decades, on
> all platforms. NetBSD has a chance to do it right (and fully compatible,
> if the other aclmodes are made available). The "aclmode=decoupled"
> is presumably also the easiest mode to implement and debug first.
>
> The interaction between acls and "owner"/"group"-based rights evaluation
> is in the platform-specific ZFS code. This presents an opportunity to
> avoid importing the enforced conflation from Linux and FreeBSD.
>
> /od2uvb


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#19
Author: zakinko
Date: Thu, 05 Nov 2026 04:00
98 lines
8138 bytes
I tried aclmode=passthrough as I said I would, and I did not find
anything to fix in OpenZFS.
I ran it on NetBSD 11.0 with the OpenZFS port and on FreeBSD 15.0, and
both behaved the same. The share allows named groups and denies a
group that holds every user, all inherited with fd, so the deny
catches anyone the allows did not:

setfacl -m 'g:admins:full_set:fd:allow,g:teachers:rwxpDdaARWcs:fd:allow,g:students:rxaRcs:fd:allow,g:everybody:full_set:fd:deny'
/tank/share

With aclmode=passthrough and aclinherit=passthrough the named entries
survived the owner's chmod 600, 666, 777 and 000, and they survived
vim, sed -i, cp, cp -p, install, tar -xp, rsync -a and mv. After chmod
777 a user in no allow entry still could not reach the file or the
directory, and a student still could not write. A teacher who does not
own the file could save it with all of those tools. On NetBSD cp -p
wrote the data and then reported an error from chmod and chflags.
A teacher's chmod fails without write_acl, as POSIX leaves chmod to
the owner, and with write_acl they can rewrite the ACL too, because
the NFSv4.1 specification, RFC 8881, makes that one right cover both.
The owner can rewrite the ACL even where it denies write_acl. RFC 8881
section 6.3.1.1 allows a server to grant that but does not require it.
Saving by rename makes the person saving the owner. A user outside the
all-users group gets in through everyone@ after chmod 666, and a
directory above that gives them nothing stops that; I checked it.
The aclmode=decoupled you suggested would close that last one, since
chmod would stop rewriting those entries. It looks to me like the mode
and ACL would then differ in the way RFC 8881 sections 6.4.1.1 and
6.4.2 rule out for owner@, group@ and everyone@, so I have not gone
further with it. I understand the 2018 thread treated this as a choice
an administrator makes knowingly.
For the owner's right, draft-ietf-nfsv4-acls-update-06 has
OWNER_RIGHTS@, like S-1-3-4 on Windows. It is still a draft. It
cancels the owner's write_acl, and since that right also covers the
mode, the owner's chmod would go with it, though the draft does not
mention chmod. Other parts of it may change what passthrough does. I
would like to leave this with the people working on NFS.

-- 
zakinko

2026年11月4日(水) 20:53 zakinko <zakinko@snowrabbit.org>:
>
> Thank you for both mails, and for the pointer to the 2018 thread,
> which I have now read through.
>
> I had first tried an aclmode=ignore, and that turned out to be the
> ignored no-op the thread warns about. I then rewrote it the way the
> thread describes as aclmode=decoupled, but I have not tested that yet,
> and I have come to wonder whether it is a good direction. With it the
> mode no longer matches the ACL, and POSIX (XBD 4.7) and RFC 8881
> section 6.4 both ask that the two be kept in step, so it could be a
> hard one to get accepted.
>
> Before going further I would like to see how far the existing
> aclmode=passthrough can go. It keeps ACEs for named users and groups
> across chmod and only rewrites owner@, group@ and everyone@, so a
> share whose rights are all in named groups may behave well already,
> although everyone@ needs some care. I will try this and write again
> with what I find.
>
> --
> zakinko
>
> 2026年11月4日(水) 19:52 <od2uvb@0w.se>:
> >
> > On Mon, Nov 02, 2026 at 01:49:23PM +0100, od2uvb@0w.se wrote:
> > > This issue has been discussed on the zfs-devel mailing list at least once
> > > (in July 2018)
> >
> > https://zfsonlinux.topicbox.com/groups/zfs-devel/T82e4ca6ba5be23dd/zfs-devel-acls-usability-was-re-native-zfs-nfs4-acl-support-issue-4966
> >
> > Please check the system administrator view there. Otherwise it looks
> > like the worlds of zfs-developers and system administrators had been
> > isolated from each other.
> >
> > The zfs acl functionality has remained woefully inadequate for decades, on
> > all platforms. NetBSD has a chance to do it right (and fully compatible,
> > if the other aclmodes are made available). The "aclmode=decoupled"
> > is presumably also the easiest mode to implement and debug first.
> >
> > The interaction between acls and "owner"/"group"-based rights evaluation
> > is in the platform-specific ZFS code. This presents an opportunity to
> > avoid importing the enforced conflation from Linux and FreeBSD.
> >
> > /od2uvb


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#18
Author: od2uvb
Date: Thu, 05 Nov 2026 09:04
129 lines
7496 bytes
Thanks a lot for looking at this seriously.

On Wed, Nov 04, 2026 at 08:53:16PM +0900, zakinko wrote:
> I had first tried an aclmode=ignore, and that turned out to be the
> ignored no-op the thread warns about. I then rewrote it the way the
> thread describes as aclmode=decoupled

This sounds great!

>  but I have not tested that yet,
> and I have come to wonder whether it is a good direction. With it the
> mode no longer matches the ACL, and POSIX (XBD 4.7) and RFC 8881
> section 6.4 both ask that the two be kept in step, so it could be a
> hard one to get accepted.

Thank you for the pointers.

Reading The Open Group Base Specifications Issue 8 IEEE Std 1003.1-2024
XKB 4.7:
"An alternate file access control mechanism shall:
*   Specify file permission bits for the file owner class, file group
    class, and file other class of that file, corresponding to the
    access permissions."

As far as I can see, strictly interpreted this would be a bug
in the standard. It is not possible to express a large class of access
permissions (e.g. involving more than one group) in modebits values.

On the other hand, if "corresponding" is to be interpreted as
"approximating", then it looks ok, even though in the decoupled case
the approximation would be really loose. No metrics of "approximation
proximity" is specified in the standard though.

The more troubling parts are "
*   Be enabled only by explicit user action, on a per-file basis by the
    file owner or a user with appropriate privileges.
*   Be disabled for a file after the file permission bits are changed
    for that file with chmod()."

This does preclude having file trees managed by ACLs, because the users
would escape the ACLs at creation of new files and at every chmod().

Given that ACLs in every implementation known to me have a provision
to automatically be inherited by newly created files, I doubt that this
part of the standard is being taken seriously.

Otherwise, the use of ACLs must be restricted to being only an
"additional", not "alternative" mechanism and only be able to further
restrict access with respect to modebits.
"An additional access control mechanism shall only further restrict the
access permissions defined by the file permission bits."
This would make it impossible e.g. to grant rights to more than one
group without granting them to everyone.

IOW I do not see a reason to follow this part of the standard, which is
already ignored in practice. Am I looking at the current version?

RFC 8881 is still only a "proposed standard" which means it can be
changed. It governs also only NFSv4, which does not prevent ZFS from
having a better ACL functionality. Nor does it preclude having multiple
different aclmodes in ZFS.

> Before going further I would like to see how far the existing
> aclmode=passthrough can go. It keeps ACEs for named users and groups
> across chmod and only rewrites owner@, group@ and everyone@, so a
> share whose rights are all in named groups may behave well already,
> although everyone@ needs some care. I will try this and write again
> with what I find.

I do not think owner@ and group@ should be involved in any way.
They confuse the users a lot and I would wish them at best not show up
at all or at least be filled with something apparently irrelevant like
all-zeros, of course stating this in the documentation for the aclmode.
Everyone@ can be applicable to filesets with public data, but it shall
not have any relation to modebits.

Yes, empty owner@/group@ ACEs might lead to surprises when moving ZFS
pools to other OSes not (yet?) supporting decoupled, but all-zeros would
be safe and setting the ACEs to some other value would only need a single
run over the corresponding file tree, once, compared to daily ACL fixes
currently needed.

Regarding your next message:
On Thu, Nov 05, 2026 at 01:00:00PM +0900, zakinko wrote:
> I tried aclmode=passthrough as I said I would, and I did not find
> anything to fix in OpenZFS.

Implementation of passthrough is probably working as intended.
It is nevertheless unfortunately, from the perspective of myself and of
my systems management colleagues, after over a decade with ZFS and NFSv4,
not the desired functionality.

You mention deficiencies like
> On NetBSD cp -p wrote the data and then reported an error from chmod
> and chflags.

A failing chmod() unfortunately breaks all programs who check its
return status. This also indirectly breaks programs who (regrettably)
analyze modebits. A prominent example is ssh but there are others too.

It is very hard to explain to the users why they encounter errors,
because the underlying logic is neither intuitive nor for the users
practically useful.

> A user outside the
> all-users group gets in through everyone@ after chmod 666.

> The owner can rewrite the ACL even where it denies write_acl.

These directly break the function of the ACL and make it impossible to
have consistent permissions in shared areas.

The passthrough mode does not look adequate, nor seems to be compliant
with XBD 4.7.

A cleanly decoupled aclmode would be highly appreciated and would also
allow to actually observe whether it will be preferred/popular compared
to the other aclmodes.

Last but not least, a consistent, easily analyzable privilege setup is
very important for handling security.

Thanks a lot for your work!

/od2uvb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#20
Author: zakinko
Date: Thu, 05 Nov 2026 11:29
163 lines
10892 bytes
Thank you for the details from your systems. Daily ACL fixes sound like
a real burden.

I take your point about XBD 4.7, and as you say, the RFC itself only
governs NFSv4. What ZFS stores, though, is an NFSv4 ACL. chmod rewrites
owner@, group@ and everyone@ because RFC 8881 section 6.4.1.1 says the
mode and the ACL have to agree, and the owner can rewrite the ACL because
section 6.3.1.1 lets a server grant WRITE_ACL on its own, so that an ACL
can always be repaired. So what you are running into comes from those
rules rather than from ZFS itself.

That is why I would rather not do this as an aclmode in ZFS, and a
decoupled aclmode would not cover everything you list anyway, as the
owner could still rewrite the ACL. I can see the value of a knob for
finding out what people actually prefer, but it would help only one file
system, and NFSv4 clients would have no way to learn that this server
handles a mode change differently.

The nfsv4 working group is revising these rules now in
draft-ietf-nfsv4-acls-update. Of the things you list, the draft so far
addresses only the owner's rights, through OWNER_RIGHTS@. Its current
text on chmod goes the other way from what you want: ACEs for named users
would be kept only if they no longer affect access. It also says this
still needs discussion. Its ACL_Choice attribute lets a server tell
clients how it handles a mode change, and new behaviours can be added
there, so a server that leaves the ACL alone might be able to say so.
I think your examples would be worth bringing there.

-- 
zakinko

2026年11月5日(木) 18:04 <od2uvb@0w.se>:
>
> Thanks a lot for looking at this seriously.
>
> On Wed, Nov 04, 2026 at 08:53:16PM +0900, zakinko wrote:
> > I had first tried an aclmode=ignore, and that turned out to be the
> > ignored no-op the thread warns about. I then rewrote it the way the
> > thread describes as aclmode=decoupled
>
> This sounds great!
>
> >  but I have not tested that yet,
> > and I have come to wonder whether it is a good direction. With it the
> > mode no longer matches the ACL, and POSIX (XBD 4.7) and RFC 8881
> > section 6.4 both ask that the two be kept in step, so it could be a
> > hard one to get accepted.
>
> Thank you for the pointers.
>
> Reading The Open Group Base Specifications Issue 8 IEEE Std 1003.1-2024
> XKB 4.7:
> "An alternate file access control mechanism shall:
> *   Specify file permission bits for the file owner class, file group
>     class, and file other class of that file, corresponding to the
>     access permissions."
>
> As far as I can see, strictly interpreted this would be a bug
> in the standard. It is not possible to express a large class of access
> permissions (e.g. involving more than one group) in modebits values.
>
> On the other hand, if "corresponding" is to be interpreted as
> "approximating", then it looks ok, even though in the decoupled case
> the approximation would be really loose. No metrics of "approximation
> proximity" is specified in the standard though.
>
> The more troubling parts are "
> *   Be enabled only by explicit user action, on a per-file basis by the
>     file owner or a user with appropriate privileges.
> *   Be disabled for a file after the file permission bits are changed
>     for that file with chmod()."
>
> This does preclude having file trees managed by ACLs, because the users
> would escape the ACLs at creation of new files and at every chmod().
>
> Given that ACLs in every implementation known to me have a provision
> to automatically be inherited by newly created files, I doubt that this
> part of the standard is being taken seriously.
>
> Otherwise, the use of ACLs must be restricted to being only an
> "additional", not "alternative" mechanism and only be able to further
> restrict access with respect to modebits.
> "An additional access control mechanism shall only further restrict the
> access permissions defined by the file permission bits."
> This would make it impossible e.g. to grant rights to more than one
> group without granting them to everyone.
>
> IOW I do not see a reason to follow this part of the standard, which is
> already ignored in practice. Am I looking at the current version?
>
> RFC 8881 is still only a "proposed standard" which means it can be
> changed. It governs also only NFSv4, which does not prevent ZFS from
> having a better ACL functionality. Nor does it preclude having multiple
> different aclmodes in ZFS.
>
> > Before going further I would like to see how far the existing
> > aclmode=passthrough can go. It keeps ACEs for named users and groups
> > across chmod and only rewrites owner@, group@ and everyone@, so a
> > share whose rights are all in named groups may behave well already,
> > although everyone@ needs some care. I will try this and write again
> > with what I find.
>
> I do not think owner@ and group@ should be involved in any way.
> They confuse the users a lot and I would wish them at best not show up
> at all or at least be filled with something apparently irrelevant like
> all-zeros, of course stating this in the documentation for the aclmode.
> Everyone@ can be applicable to filesets with public data, but it shall
> not have any relation to modebits.
>
> Yes, empty owner@/group@ ACEs might lead to surprises when moving ZFS
> pools to other OSes not (yet?) supporting decoupled, but all-zeros would
> be safe and setting the ACEs to some other value would only need a single
> run over the corresponding file tree, once, compared to daily ACL fixes
> currently needed.
>
> Regarding your next message:
> On Thu, Nov 05, 2026 at 01:00:00PM +0900, zakinko wrote:
> > I tried aclmode=passthrough as I said I would, and I did not find
> > anything to fix in OpenZFS.
>
> Implementation of passthrough is probably working as intended.
> It is nevertheless unfortunately, from the perspective of myself and of
> my systems management colleagues, after over a decade with ZFS and NFSv4,
> not the desired functionality.
>
> You mention deficiencies like
> > On NetBSD cp -p wrote the data and then reported an error from chmod
> > and chflags.
>
> A failing chmod() unfortunately breaks all programs who check its
> return status. This also indirectly breaks programs who (regrettably)
> analyze modebits. A prominent example is ssh but there are others too.
>
> It is very hard to explain to the users why they encounter errors,
> because the underlying logic is neither intuitive nor for the users
> practically useful.
>
> > A user outside the
> > all-users group gets in through everyone@ after chmod 666.
>
> > The owner can rewrite the ACL even where it denies write_acl.
>
> These directly break the function of the ACL and make it impossible to
> have consistent permissions in shared areas.
>
> The passthrough mode does not look adequate, nor seems to be compliant
> with XBD 4.7.
>
> A cleanly decoupled aclmode would be highly appreciated and would also
> allow to actually observe whether it will be preferred/popular compared
> to the other aclmodes.
>
> Last but not least, a consistent, easily analyzable privilege setup is
> very important for handling security.
>
> Thanks a lot for your work!
>
> /od2uvb


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Re: OpenZFS on NetBSD
#21
Author: od2uvb
Date: Thu, 05 Nov 2026 14:42
78 lines
5343 bytes
Hello zakinko,

On Thu, Nov 05, 2026 at 08:29:38PM +0900, zakinko wrote:
> What ZFS stores, though, is an NFSv4 ACL. chmod rewrites
> owner@, group@ and everyone@ because RFC 8881 section 6.4.1.1 says the
> mode and the ACL have to agree and the owner can rewrite the ACL because
> section 6.3.1.1 lets a server grant WRITE_ACL on its own, so that an ACL
> can always be repaired.

Why does ZFS have to follow NFS in this respect? This should not be
necessary at least in the installations which do not export ZFS via
NFS. Also, what NFS exposes and applies does not have to be exactly what
the underlying file system offers.

The owner exception is a feature very deeply connected to the Unix
original acl model aka modebits. It is contradicting the very role of
the _Access_Control_ list, thus is counterproductive and confusing.
Above all, it is _not_ necessary.
An exception for root is fully sufficient.

Consider also that the users can easily isolate themselves from their data
in other ways. It is e.g. easy to unlink() a newly edited large file.
There is not even any "superuser exception" in Unix for reverting the result.

> So what you are running into comes from those
> rules rather than from ZFS itself.

ZFS is not a part of NFS, nor vice versa, why are you assuming
that they must behave identically?

Of course, NFS suffers from the same design problem that we discuss. Worse,
the draft-ietf-nfsv4-acls-update-06 which you mentioned, seems to make the
rules even more complicated, for the sake of a specific implementation
of yet non-standard ACLs (Linux ones). That's very sad.

> That is why I would rather not do this as an aclmode in ZFS, and a
> decoupled aclmode would not cover everything you list anyway, as the
> owner could still rewrite the ACL.

No, they could not rewrite. "Decoupled" must _not_ have any exceptions
for the owner. ACLs do not have to bear the load of bad Unix heritage.

ACLs are very easy to explain when they do not depend on properties like
"who has created the file" and "to which group that process belonged"
and "which umask that process had."

> I can see the value of a knob for
> finding out what people actually prefer, but it would help only one file
> system, and NFSv4 clients would have no way to learn that this server
> handles a mode change differently.

Why would NFS clients have to learn? Why not the users? They in any
case must be somehow made aware of the server policies.

The proposed decoupled mode does not break any usual Unix semantics,
besides for programs who try to use access bits for security-related
conclusions. This practice is not only racy but plainly wrong as soon
as there is an ACL richer than modebits.
The usual chmod command can always give a relief to such an application,
in decoupled mode the ACLs do not influence modebits operations.

> The nfsv4 working group is revising these rules now in
> draft-ietf-nfsv4-acls-update. ...
> goes the other way from what you want
> ...
> I think your examples would be worth bringing there.

It is apparent that the working group has an agenda unrelated to reducing
confusion. I think the only argument, if any, that possibly could influence
such a group would be a working implementation, delivering its promise
in practice. The users will love it.

Thanks
/od2uvb

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads