Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionJ. Bruce Fields
2020-12-07 18:14:00 UTC
A new attribute was added to NFSv4.2 allowing clients to pass create mode and umask separately when creating new objects. The server implemented tihs by setting the process umask before calling into the vfs to create the object. Unfortunately, the server forgot to clear the umask afterwards. The effect is that a later RPC processed by the same server thread could set the wrong permissions on a newly-created object.
The incorrect permissions will always be more restrictive than necessary, which may limit security impact. Also, I don't think we've seen reports of users running into this. Still, it seems like a pretty bad bug, affecting RHEL since 7.4.
Fixed by b5396f6101cb "nfsd: fix incorrect umasks", which backports easily.
(In reply to J. Bruce Fields from comment #0)
> Also, I don't think we've seen reports of
> users running into this.
I take that back, see bug 1903303.
To reproduce this you need client processes using a mixture of different umasks, I wonder how frequent that is in typical environments. You also need a mixture of 4.2 and non-4.2 clients. I think we'll be seeing more of this as people upgrade. So this should be backported to z-stream.
Hi,
(In reply to J. Bruce Fields from comment #10 of bug 1903303)
> > That could explain why I couldn't trigger it on another server. The 4.2
> > traffic setting the umask must be hitting the server at the right time to
> > trigger this?
>
> Right. A non-NFSv4.2 create may end up applying the umask of a previous
> NFSv4.2 create.
If that's really what is happening, it's strange that the resulting umask getting applied is always removing access for the owner of the file. That's a _very_ unlikely umask to be using, no?
In my case, the resulting permissions were 0. I really doubt any of our users is using a umask that removes their own permissions and is generating enough traffic to trigger this so easily. Or am I missing something?
So while it seems plausible it's this bug, I'm not 100% convinced.
In our environment, users access their home directory over NFS so having a mixture of umasks is not that unlikely. We have clients running CentOS 7, 8 and Fedora, so different NFS versions.
Regards,
Rik
(In reply to Rik Theys from comment #5)
> (In reply to J. Bruce Fields from comment #10 of bug 1903303)
> > Right. A non-NFSv4.2 create may end up applying the umask of a previous
> > NFSv4.2 create.
>
> If that's really what is happening, it's strange that the resulting umask
> getting applied is always removing access for the owner of the file. That's
> a _very_ unlikely umask to be using, no?
Traditionally (before the new NFSv4.2 feature), the client applies the umask before it sends the OPEN or CREATE. With this bug, the server is applying a *second* umask, masking out additional bits.
> In our environment, users access their home directory over NFS so having a
> mixture of umasks is not that unlikely. We have clients running CentOS 7, 8
> and Fedora, so different NFS versions.
Thanks for the additional background.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: kernel security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2021:0336