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.

Bug 2062163

Summary: AVC popping up when logging in on virtual console on GUI systems
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: lvrabec, mmalik, ssekidde
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-03-09 10:30:49 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-03-09 10:16:34 UTC
Description of problem:

After switching to text console (e.g. tty2), login pops an AVC searching for cgroup filesystem just after entering the username (e.g. root) and before entering the password.

AVC:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
type=PROCTITLE msg=audit(03/09/2022 05:11:13.029:233) : proctitle=/bin/login -p --      
type=PATH msg=audit(03/09/2022 05:11:13.029:233) : item=0 name=/sys/fs/cgroup/ inode=12493 dev=00:19 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:cgroup_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(03/09/2022 05:11:13.029:233) : cwd=/ 
type=SYSCALL msg=audit(03/09/2022 05:11:13.029:233) : arch=x86_64 syscall=statfs success=no exit=EACCES(Permission denied) a0=0x7f74d63d5d89 a1=0x7fffefe48a10 a2=0x55c949cc8480 a3=0x0 items=1 ppid=1 pid=3068 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=tty3 ses=unset comm=login exe=/usr/bin/login subj=system_u:system_r:local_login_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(03/09/2022 05:11:13.029:233) : avc:  denied  { getattr } for  pid=3068 comm=login name=/ dev="tmpfs" ino=12493 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmpfs_t:s0 tclass=filesystem permissive=0 
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


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

selinux-policy-3.14.3-80.el8_5.2.noarch

How reproducible:

Always

Steps to Reproduce:
1. Install a VM with GUI
2. Switch to vt2 and log in

Actual results:

AVC

Expected results:

No AVC

Additional info:

Happens with GUI only

Comment 1 Renaud Métrich 2022-03-09 10:30:49 UTC
OK This is a dup of BZ #2015539, sorry for that.

(gdb) bt
#0  0x00007fa7a9b19fdb in statfs64 () at ../sysdeps/unix/syscall-template.S:78
#1  0x00007fa7a88cbbba in cg_unified_update () at ../src/basic/cgroup-util.c:2496
#2  0x00007fa7a88cd335 in cg_unified_update () at ../src/basic/string-util.h:32
#3  cg_unified_controller (controller=0x7fa7a89279da "_systemd") at ../src/basic/cgroup-util.c:2537
#4  0x00007fa7a88cd3b3 in cg_pid_get_path (controller=0x7fa7a89279da "_systemd", pid=0, path=0x7ffe874fcba8)
    at ../src/basic/cgroup-util.c:1013
#5  0x00007fa7a88cd9b1 in cg_pid_get_path_shifted (pid=<optimized out>, root=0x0, cgroup=0x7ffe874fcbf0)
    at ../src/basic/cgroup-util.c:1417
#6  0x00007fa7a88cdcdf in cg_pid_get_session (pid=<optimized out>, session=0x7ffe874fcc40)
    at ../src/basic/cgroup-util.c:1728
#7  0x00007fa7a88a2b66 in sd_pid_get_session (pid=<optimized out>, session=<optimized out>)
    at ../src/libsystemd/sd-login/sd-login.c:49
#8  0x00007fa7a88a2c55 in file_of_session (session=<optimized out>, _p=0x7ffe874fcc78)
    at ../src/libsystemd/sd-login/sd-login.c:444
#9  0x00007fa7a88a3bc6 in sd_session_is_remote (session=session@entry=0x0)
    at ../src/libsystemd/sd-login/sd-login.c:481
#10 0x00007fa7a8b726f0 in is_remote (pamh=0x559c86e35610) at ../pam/pam_fprintd.c:728
#11 pam_sm_authenticate (pamh=0x559c86e35610, flags=<optimized out>, argc=0, argv=0x0) at ../pam/pam_fprintd.c:744
#12 0x00007fa7aa44d7b4 in _pam_dispatch_aux (use_cached_chain=<optimized out>, resumed=<optimized out>, 
    h=0x559c86e40690, flags=0, pamh=0x559c86e35610) at pam_dispatch.c:110
#13 _pam_dispatch (pamh=pamh@entry=0x559c86e35610, flags=0, choice=choice@entry=1) at pam_dispatch.c:426
#14 0x00007fa7aa44d083 in pam_authenticate (pamh=0x559c86e35610, flags=<optimized out>) at pam_auth.c:34
#15 0x0000559c85209e4f in loginpam_auth (cxt=0x7ffe874fcf20) at login-utils/login.c:771
#16 main (argc=<optimized out>, argv=<optimized out>) at login-utils/login.c:1229
(gdb)

*** This bug has been marked as a duplicate of bug 2015539 ***