Bug 2039725

Summary: signull AVC seen when NetworkManager checks NetworkManager-wait-online state when hidepid=2 is used
Product: Red Hat Enterprise Linux 9 Reporter: Renaud Métrich <rmetrich>
Component: systemdAssignee: systemd-maint
Status: CLOSED WONTFIX QA Contact: Frantisek Sumsal <fsumsal>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: bgalvani, dtardon, lrintel, rkhan, sukulkar, systemd-maint-list, till
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-24 08:06:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Renaud Métrich 2022-01-12 10:14:56 UTC
Description of problem:

Some customers used "hidepid=2,gid=xxx" in the past (up to RHEL7) to hide processes from other users.
With RHEL8, when setting such option, we can see signull AVC, which seem to prevent normal operation to complete, e.g.

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
type=PROCTITLE msg=audit(01/10/2022 15:35:30.024:31) : proctitle=/usr/sbin/NetworkManager --no-daemon 
type=SYSCALL msg=audit(01/10/2022 15:35:30.024:31) : arch=x86_64 syscall=kill success=no exit=EACCES(Permission denied) a0=0x4a1 a1=SIG0 a2=0x0 a3=0x0 items=0 ppid=1 pid=1148 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=NetworkManager exe=/usr/sbin/NetworkManager subj=system_u:system_r:NetworkManager_t:s0 key=(null) 
type=AVC msg=audit(01/10/2022 15:35:30.024:31) : avc:  denied  { signull } for  pid=1148 comm=NetworkManager scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=process permissive=0 
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Here above NetworkManager tries to "ping" NetworkManager-wait-online process

Kernel guys confirmed through BZ #2038929 that the "hidepid=2" /proc functionality is supported and useful.

Please confirm NetworkManager and NetworkManager-wait-online interaction still works even though the AVC happens and possibly redirect to selinux-policy based on your analysis.


Version-Release number of selected component (if applicable):


How reproducible:

Always

Steps to Reproduce:

1. Set options in /etc/fstab

  proc /proc proc rw,nosuid,nodev,noexec,relatime,hidepid=2,gid=1000 0 0

2. Reboot

Actual results:

signull AVC dropped by NetworkManager

Comment 1 Till Maas 2022-02-15 09:15:24 UTC
(In reply to Renaud Métrich from comment #0)

> Kernel guys confirmed through BZ #2038929 that the "hidepid=2" /proc
> functionality is supported and useful.

Actually, I read there that it is not supported and not useful. 

https://access.redhat.com/solutions/6704531 states: "Because of these issues we don't recommend at this time using hidepid= option on Red Hat Enterprise Linux 7 and newer."

Therefore, I consider this a duplicate of bug 2038929. Please confirm or clarify this. We will close this BZ in a week otherwise. Thank you.

Comment 2 Renaud Métrich 2022-02-15 09:46:35 UTC
Yes this new solution states that hidepid should not be used on 7 and 8.
Hence you may close this, unless you want to reuse the BZ for rhel 9 (IMHO recent systemd will support hidepid functionality somehow).

Comment 4 Beniamino Galvani 2022-05-24 07:28:25 UTC
In https://access.redhat.com/solutions/6704531, the systemd team said that hidepid=2 is not recommended on RHEL7 and RHEL8.

Did that change on RHEL9? Reassigning to systemd for evaluation. If hidepid=2 is still not recommended on RHEL9, please close this bz, otherwise reassign it back to NM. Thank you.

Comment 5 David Tardon 2022-05-24 08:06:24 UTC
(In reply to Beniamino Galvani from comment #4)
> In https://access.redhat.com/solutions/6704531, the systemd team said that
> hidepid=2 is not recommended on RHEL7 and RHEL8.
> 
> Did that change on RHEL9?

It did not.