Bug 2112782 - avc: denied { read } for comm="agetty" name="22_clhm_eth0.issue"
Summary: avc: denied { read } for comm="agetty" name="22_clhm_eth0.issue"
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 41
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: CockpitTest
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-01 05:49 UTC by Martin Pitt
Modified: 2025-12-16 17:05 UTC (History)
22 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-12-16 17:05:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Martin Pitt 2022-08-01 05:49:37 UTC
Description of problem: The most recent NM release [1] in Fedora 36 changed something which violates its SELinux policy. Our Cockpit tests caught that [2], but that update was fast-paced through updates-testing, so we couldn't stop it in updates-testing.


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

NetworkManager 1:1.38.2-1.fc36

This is not 100% reproducible in the same test -- in two runs [3][4] it happened during a different test:

audit: type=1400 audit(1659136213.150:4741): avc:  denied  { read } for  pid=781 comm="agetty" name="22_clhm_eth0.issue" dev="vda5" ino=181039 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:NetworkManager_dispatcher_console_var_run_t:s0 tclass=file permissive=0

Full journal at [5].



Additional info:
[1] https://bodhi.fedoraproject.org/updates/FEDORA-2022-740eda1e5f
[2] https://github.com/cockpit-project/bots/pull/3673
[3] https://cockpit-logs.us-east-1.linodeobjects.com/pull-3673-20220729-225959-cda7eda8-fedora-testing-cockpit-project-cockpit/log.html#66
[4] https://cockpit-logs.us-east-1.linodeobjects.com/pull-3673-20220730-124011-cda7eda8-fedora-testing-cockpit-project-cockpit/log.html#72
[5] https://cockpit-logs.us-east-1.linodeobjects.com/pull-3673-20220729-225959-cda7eda8-fedora-testing-cockpit-project-cockpit/TestNetworkingBasic-testNoService-fedora-testing-127.0.0.2-2501-FAIL.log.gz

Comment 1 Thomas Haller 2022-08-01 07:26:42 UTC
I am not entirely sure, but I think this is not triggered by NetworkManager. Instead, it's triggered by a NetworkManager-dispatcher scripts. The NetworkManager dispatcher service that executes the scripts is part of NetworkManager, but the executed scripts are not.

There was a recent rework about the relabeling of those scripts. This issue is probably related.

Reassigning to SELinux.

Comment 2 Martin Pitt 2022-08-01 07:41:40 UTC
I filed this against NM because in our image refresh the changed packages were exactly these:

  NetworkManager (1:1.38.0-2.fc36 -> 1:1.38.2-1.fc36)
  NetworkManager-libnm (1:1.38.0-2.fc36 -> 1:1.38.2-1.fc36)
  NetworkManager-team (1:1.38.0-2.fc36 -> 1:1.38.2-1.fc36)
  bluez (5.64-1.fc36 -> 5.65-1.fc36)
  cockpit (272-1.fc36 -> 273-1.fc36)
  cockpit-bridge (272-1.fc36 -> 273-1.fc36)
  cockpit-system (272-1.fc36 -> 273-1.fc36)
  cockpit-ws (272-1.fc36 -> 273-1.fc36)
  kexec-tools (2.0.23-6.fc36 -> 2.0.24-4.fc36)
  libtirpc (1.3.2-1.rc1.fc36.1 -> 1.3.2-1.rc4.fc36)
  mozjs91 (91.11.0-1.fc36 -> 91.12.0-1.fc36)
  osinfo-db (20220516-1.fc36 -> 20220727-1.fc36)
  qt5-srpm-macros (5.15.3-1.fc36 -> 5.15.5-2.fc36)
  rust-srpm-macros (21-1.fc36 -> 22-1.fc36)
  stratisd (3.1.1-2.fc36 -> 3.1.2-1.fc36)
  tpm2-tss (3.2.0-1.fc36 -> 3.2.0-3.fc36)
  usbredir (0.12.0-2.fc36 -> 0.12.0-3.fc36)
  vim-data (2:9.0.049-1.fc36 -> 2:9.0.077-1.fc36)
  vim-minimal (2:9.0.049-1.fc36 -> 2:9.0.077-1.fc36)
  xen-libs (4.16.1-6.fc36 -> 4.16.1-8.fc36)
  xen-licenses (4.16.1-6.fc36 -> 4.16.1-8.fc36)

I.e. there was *no* new selinux-policy version. The only relevant one from the above list is NM.

Comment 3 Allison Karlitskaya 2022-08-29 08:27:51 UTC
We're not seeing this problem anymore in our CI.  Probably fixed by selinux-policy updates.

Comment 4 Martin Pitt 2022-08-31 09:27:15 UTC
Nope, this is still a thing. Just spotted here: https://cockpit-logs.us-east-1.linodeobjects.com/pull-17690-20220831-090751-b2b6e410-fedora-37-bots-3801/log.html#66

Comment 5 Zdenek Pytela 2022-08-31 16:48:21 UTC
(In reply to Martin Pitt from comment #4)
> Nope, this is still a thing. Just spotted here:
> https://cockpit-logs.us-east-1.linodeobjects.com/pull-17690-20220831-090751-
> b2b6e410-fedora-37-bots-3801/log.html#66

I cannot trigger the denial on my vm and some details are missing in the report. Can you re-run the test with full auditing enabled?

1) Open the /etc/audit/rules.d/audit.rules file in an editor.
2) Remove the following line if it exists:
-a task,never
3) Add the following line to the end of the file:
-w /etc/shadow -p w
4) Restart the audit daemon:
  # service auditd restart
5) Re-run your scenario.
6) Collect AVC denials:
  # ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts today

Comment 6 Martin Pitt 2022-09-02 10:07:39 UTC
I can reproduce that fairly reliably on F37 with our TestNetworkingBasic.testNoService test. I did steps 1-3, then

> 4) Restart the audit daemon:
>  # service auditd restart

this doesn't work:

  auditd[5107]: Could not open dir /var/log/audit (No such file or directory)
  auditd.service: Control process exited, code=exited, status=6/NOTCONFIGURED

OOOKay, missing a tmpfiles.d/ snippet?

This works, including the config changes:

  mkdir -p /var/log/audit
  touch /var/log/audit.log
  restorecon -r /var/log/audit
  sed -i '/^-a task/d; $ a-w /etc/shadow -p w' /etc/audit/rules.d/audit.rules
  service auditd restart

ausearch picks up a ton of messages (see all the other bugs that I filed/tagged), but this is the clhm issue:


type=PROCTITLE msg=audit(09/02/2022 10:05:24.481:2151) : proctitle=mv /run/console-login-helper-messages/console-login-helper-messages.9lT2oRwxoA.tmp /etc/issue.d/22_clhm_eth0.issue 
type=PATH msg=audit(09/02/2022 10:05:24.481:2151) : item=0 name=(null) inode=2274 dev=00:1a mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:NetworkManager_dispatcher_console_var_run_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(09/02/2022 10:05:24.481:2151) : cwd=/ 
type=SYSCALL msg=audit(09/02/2022 10:05:24.481:2151) : arch=x86_64 syscall=flistxattr success=yes exit=17 a0=0x3 a1=0x7fffba254380 a2=0x11 a3=0x7fffba2559c1 items=1 ppid=8338 pid=8346 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=mv exe=/usr/bin/mv subj=system_u:system_r:NetworkManager_dispatcher_console_t:s0 key=(null) 
type=AVC msg=audit(09/02/2022 10:05:24.481:2151) : avc:  denied  { sys_admin } for  pid=8346 comm=mv capability=sys_admin  scontext=system_u:system_r:NetworkManager_dispatcher_console_t:s0 tcontext=system_u:system_r:NetworkManager_dispatcher_console_t:s0 tclass=capability permissive=0 

# ls -lZ /etc/issue.d/22_clhm_eth0.issue 
-rw-r--r--. 1 root root system_u:object_r:etc_t:s0 24 Sep  2 10:05 /etc/issue.d/22_clhm_eth0.issue

/run/console-login-helper-messages/ is empty.

Comment 7 Aoife Moloney 2023-11-23 00:16:29 UTC
This message is a reminder that Fedora Linux 37 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '37'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 37 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 8 Martin Pitt 2023-11-23 06:06:34 UTC
This is provably still happen in current Fedoras: https://github.com/cockpit-project/bots/issues/3683

Comment 9 Martin Pitt 2024-03-18 06:18:39 UTC
We haven't seen this any more in the last few months, so closing.

Comment 10 Martin Pitt 2025-01-28 07:54:02 UTC
This still actually happens, we just don't fail cockpit's tests on it any more. On current Fedora 41:

AVC avc:  denied  { read } for  pid=886 comm="agetty" name="22_clhm_ens14.issue" dev="vda4" ino=89566 scontext=system_u:system_r:getty_t:s0-s0:c0.c1023 tcontext=system_u:object_r:NetworkManager_dispatcher_console_var_run_t:s0 tclass=file permissive=0

Comment 11 Adam Williamson 2025-12-02 01:11:45 UTC
This message is a reminder that Fedora Linux 41 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 41 on 2025-12-15.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '41'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 41 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 12 Samyak Jain (RedHat) 2025-12-16 17:05:15 UTC
Fedora Linux 41 entered end-of-life (EOL) status on 2025-12-15.

Fedora Linux 41 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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