Bug 2180611 - SELinux is preventing nfsidmap from 'read' accesses on the directory userdb.
Summary: SELinux is preventing nfsidmap from 'read' accesses on the directory userdb.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 38
Hardware: x86_64
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:0c75e9dad060c91dd85759c35ba...
: 2180608 2188783 2190385 2192241 2196911 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-21 21:18 UTC by James
Modified: 2023-05-31 17:32 UTC (History)
15 users (show)

Fixed In Version: selinux-policy-38.15-1.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-31 17:32:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: description (1.90 KB, text/plain)
2023-03-21 21:18 UTC, James
no flags Details
File: os_info (756 bytes, text/plain)
2023-03-21 21:18 UTC, James
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1673 0 None open Allow nfsidmapd work with systemd-userdbd and sssd 2023-05-09 15:44:35 UTC

Description James 2023-03-21 21:18:10 UTC
Description of problem:
Tried to mount NFSv4 share, sec=krb5
SELinux is preventing nfsidmap from 'read' accesses on the directory userdb.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that nfsidmap should be allowed read access on the userdb directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'nfsidmap' --raw | audit2allow -M my-nfsidmap
# semodule -X 300 -i my-nfsidmap.pp

Additional Information:
Source Context                system_u:system_r:nfsidmap_t:s0
Target Context                system_u:object_r:systemd_userdbd_runtime_t:s0
Target Objects                userdb [ dir ]
Source                        nfsidmap
Source Path                   nfsidmap
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-38.8-2.fc38.noarch
Local Policy RPM              selinux-policy-targeted-38.8-2.fc38.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.2.7-300.fc38.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Fri Mar 17 16:02:49 UTC 2023
                              x86_64
Alert Count                   21
First Seen                    2023-03-18 14:14:05 GMT
Last Seen                     2023-03-21 21:08:16 GMT
Local ID                      dbe72d20-8c09-44fc-b96a-8f4b4b845832

Raw Audit Messages
type=AVC msg=audit(1679432896.347:251): avc:  denied  { read } for  pid=3812 comm="nfsidmap" name="userdb" dev="tmpfs" ino=43 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:systemd_userdbd_runtime_t:s0 tclass=dir permissive=0


Hash: nfsidmap,nfsidmap_t,systemd_userdbd_runtime_t,dir,read

Version-Release number of selected component:
selinux-policy-targeted-38.8-2.fc38.noarch

Additional info:
reporter:       libreport-2.17.8
reason:         SELinux is preventing nfsidmap from 'read' accesses on the directory userdb.
package:        selinux-policy-targeted-38.8-2.fc38.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.2.7-300.fc38.x86_64
comment:        Tried to mount NFSv4 share, sec=krb5
component:      selinux-policy

Comment 1 James 2023-03-21 21:18:13 UTC
Created attachment 1952535 [details]
File: description

Comment 2 James 2023-03-21 21:18:14 UTC
Created attachment 1952536 [details]
File: os_info

Comment 3 Jason Tibbitts 2023-05-02 02:37:33 UTC
I just wanted to add some related AVCs that I see when attempting to access an home directory mounted over NFS4 with sec=krb5p.  The user database is in LDAP and this is mediated via SSSD.  In enforcing mode, the end result is that the user can log in, but the ownership of all files appears as "nobody:nobody".

Note that these AVCs were collected after running setenforce 0.  It appears that several SSSD operations would need to be allowed.

time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.749:202): avc:  denied  { search } for  pid=1718 comm="nfsidmap" name="sss" dev="dm-1" ino=148 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=dir permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.749:203): avc:  denied  { read } for  pid=1718 comm="nfsidmap" name="passwd" dev="dm-1" ino=190 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.749:204): avc:  denied  { open } for  pid=1718 comm="nfsidmap" path="/var/lib/sss/mc/passwd" dev="dm-1" ino=190 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.749:205): avc:  denied  { getattr } for  pid=1718 comm="nfsidmap" path="/var/lib/sss/mc/passwd" dev="dm-1" ino=190 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.749:206): avc:  denied  { map } for  pid=1718 comm="nfsidmap" path="/var/lib/sss/mc/passwd" dev="dm-1" ino=190 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_public_t:s0 tclass=file permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.750:207): avc:  denied  { write } for  pid=1719 comm="nfsidmap" name="nss" dev="dm-1" ino=8401893 scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:object_r:sssd_var_lib_t:s0 tclass=sock_file permissive=1
----
time->Mon May  1 21:33:14 2023
type=AVC msg=audit(1682994794.750:208): avc:  denied  { connectto } for  pid=1719 comm="nfsidmap" path="/var/lib/sss/pipes/nss" scontext=system_u:system_r:nfsidmap_t:s0 tcontext=system_u:system_r:sssd_t:s0 tclass=unix_stream_socket permissive=1

Comment 4 Ondrej Mosnáček 2023-05-02 09:51:56 UTC
*** Bug 2188783 has been marked as a duplicate of this bug. ***

Comment 5 Zdenek Pytela 2023-05-02 17:22:14 UTC
*** Bug 2192241 has been marked as a duplicate of this bug. ***

Comment 6 Zdenek Pytela 2023-05-09 15:44:36 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/1673

Please try the scratchbuild
Checks -> Artifacts -> rpms.zip

to see if the update is sufficient.

Comment 7 Zdenek Pytela 2023-05-10 13:21:36 UTC
*** Bug 2190385 has been marked as a duplicate of this bug. ***

Comment 8 Zdenek Pytela 2023-05-11 06:52:54 UTC
*** Bug 2196911 has been marked as a duplicate of this bug. ***

Comment 9 Zdenek Pytela 2023-05-11 21:12:32 UTC
*** Bug 2180608 has been marked as a duplicate of this bug. ***

Comment 10 Brendan 2023-05-17 20:23:32 UTC
(In reply to Zdenek Pytela from comment #6)
> I've submitted a Fedora PR to address the issue:
> https://github.com/fedora-selinux/selinux-policy/pull/1673
> 
> Please try the scratchbuild
> Checks -> Artifacts -> rpms.zip
> 
> to see if the update is sufficient.

This update fixes the issue for me.  Thank you!

Comment 11 Fedora Update System 2023-05-30 19:31:26 UTC
FEDORA-2023-a19eb5132c has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a19eb5132c

Comment 12 Fedora Update System 2023-05-31 02:50:36 UTC
FEDORA-2023-a19eb5132c has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a19eb5132c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a19eb5132c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2023-05-31 17:32:07 UTC
FEDORA-2023-a19eb5132c has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.