Bug 2186595
| Summary: | SELinux is preventing kworker/30:1 from map_read, map_write access on the bpf labeled kernel_t. | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mikhail <mikhail.v.gavrilov> | ||||||
| Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | unspecified | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 38 | CC: | dominik, dwalsh, goeran, kparal, lvrabec, mikhail.v.gavrilov, mmalik, omosnacek, pkoncity, vmojzis, vondruch, zpytela | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Unspecified | ||||||||
| Whiteboard: | abrt_hash:b8104f3440c31c32f541a39861226f16600a9838c36b48899dbce9f6deac6f0a;VARIANT_ID=workstation; | ||||||||
| Fixed In Version: | selinux-policy-38.21-1.fc38 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2023-07-18 01:24:20 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
Created attachment 1957374 [details]
File: description
Created attachment 1957375 [details]
File: os_info
Is it possible to reliably trigger the denial? If yes, could you please run the following: # echo stacktrace >/sys/kernel/tracing/trace_options # echo 1 >/sys/kernel/tracing/events/avc/selinux_audited/enable ...then trigger the denial, and then paste the output of `cat /sys/kernel/tracing/trace`? It should give us its kernel backtrace, which will help us figure out what is going on. You can reset the tracing settings afterwards by rebooting or by running: # echo nostacktrace >/sys/kernel/tracing/trace_options # echo 0 >/sys/kernel/tracing/events/avc/selinux_audited/enable *** Bug 2188940 has been marked as a duplicate of this bug. *** *** Bug 2192185 has been marked as a duplicate of this bug. *** *** Bug 2188971 has been marked as a duplicate of this bug. *** *** Bug 2203635 has been marked as a duplicate of this bug. *** *** Bug 2208472 has been marked as a duplicate of this bug. *** *** Bug 2208512 has been marked as a duplicate of this bug. *** Hint from one of the duplicates:
> Seems to have happened during system suspend or resume.
Still, we are looking for confirmation and a reliable reproducer.
Further debugging information is highly appreciated.
I have hit the bug #2208472 right after the boot. But I think that also today, connecting my LP to docking station. Also, I think this is Kernel 6.3 related. Good catch, Vit, actually 6.3.3-200.fc38.x86_64 6.3.0-0.rc6.20230412gite62252bc55b6.51.fc39.x86_64+debug 6.3.0-0.rc7.20230420gitcb0856346a60.59.fc39.x86_64+debug 6.4.0-0.rc0.20230428git33afd4b76393.7.fc39.x86_64+debug in the reported bzs. At least something we can work with. (In reply to Zdenek Pytela from comment #12) > Good catch, Vit, actually > > 6.3.3-200.fc38.x86_64 > 6.3.0-0.rc6.20230412gite62252bc55b6.51.fc39.x86_64+debug > 6.3.0-0.rc7.20230420gitcb0856346a60.59.fc39.x86_64+debug > 6.4.0-0.rc0.20230428git33afd4b76393.7.fc39.x86_64+debug > > in the reported bzs. At least something we can work with. Yeah, I have updated one system, where there was still just 6.2 available and it was Ok. The other system updated yesterday has already 6.3 and that exhibits the issue. Just a note: I am unable to reproduce the problem on a vm and therefore I cannot gather any additional data, will try a physical system. On my system it seems to happen reliably after each suspend-resume cycle. This is what happened when I disconnected my LP from docking station:
~~~
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:03:01.0: pciehp: Slot(1): Link Down
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:03:01.0: pciehp: Slot(1): Card not present
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:06:04.0: Unable to change power state from D3hot to D0, device inaccessible
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:06:04.0: Runtime PM usage count underflow!
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: remove, state 1
May 19 18:24:10 localhost.localdomain kernel: usb usb6: USB disconnect, device number 1
May 19 18:24:10 localhost.localdomain kernel: usb 6-2: USB disconnect, device number 2
May 19 18:24:10 localhost.localdomain kernel: usb 6-2.1: USB disconnect, device number 3
May 19 18:24:10 localhost.localdomain kernel: r8152-cfgselector 6-2.1.2: USB disconnect, device number 4
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: xHCI host controller not responding, assume dead
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: USB bus 6 deregistered
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: remove, state 1
May 19 18:24:10 localhost.localdomain kernel: usb usb5: USB disconnect, device number 1
May 19 18:24:10 localhost.localdomain kernel: usb 5-2: USB disconnect, device number 2
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1: USB disconnect, device number 3
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1.1: USB disconnect, device number 6
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1.1.2: USB disconnect, device number 9
May 19 18:24:10 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:03:01.0: pciehp: Slot(1): Link Down
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:03:01.0: pciehp: Slot(1): Card not present
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:06:04.0: Unable to change power state from D3hot to D0, device inaccessible
May 19 18:24:10 localhost.localdomain kernel: pcieport 0000:06:04.0: Runtime PM usage count underflow!
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: remove, state 1
May 19 18:24:10 localhost.localdomain kernel: usb usb6: USB disconnect, device number 1
May 19 18:24:10 localhost.localdomain kernel: usb 6-2: USB disconnect, device number 2
May 19 18:24:10 localhost.localdomain kernel: usb 6-2.1: USB disconnect, device number 3
May 19 18:24:10 localhost.localdomain kernel: r8152-cfgselector 6-2.1.2: USB disconnect, device number 4
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: xHCI host controller not responding, assume dead
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: USB bus 6 deregistered
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: remove, state 1
May 19 18:24:10 localhost.localdomain kernel: usb usb5: USB disconnect, device number 1
May 19 18:24:10 localhost.localdomain kernel: usb 5-2: USB disconnect, device number 2
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1: USB disconnect, device number 3
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1.1: USB disconnect, device number 6
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1.1.2: USB disconnect, device number 9
May 19 18:24:10 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.1.4: USB disconnect, device number 10
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.2: USB disconnect, device number 4
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.3: USB disconnect, device number 5
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.4: USB disconnect, device number 11
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.5: USB disconnect, device number 7
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: Host halt failed, -19
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: Host not accessible, reset failed.
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: USB bus 5 deregistered
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:07: busn_res: [bus 07] is released
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:08: busn_res: [bus 08-39] is released
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:06: busn_res: [bus 06-39] is released
May 19 18:24:10 localhost.localdomain kernel: thunderbolt 0-1: device disconnected
May 19 18:24:12 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:12 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dbus-:1.3-org.fedoraproject.SetroubleshootPrivileged@4 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:15 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=packagekit comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:20 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:23 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dbus-:1.3-org.fedoraproject.SetroubleshootPrivileged@4 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:23 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:24 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
.4: USB disconnect, device number 10
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.2: USB disconnect, device number 4
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.3: USB disconnect, device number 5
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain audit[76747]: AVC avc: denied { map_read map_write } for pid=76747 comm="kworker/7:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.4: USB disconnect, device number 11
May 19 18:24:10 localhost.localdomain kernel: usb 5-2.5: USB disconnect, device number 7
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: Host halt failed, -19
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: Host not accessible, reset failed.
May 19 18:24:10 localhost.localdomain kernel: xhci_hcd 0000:07:00.0: USB bus 5 deregistered
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:07: busn_res: [bus 07] is released
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:08: busn_res: [bus 08-39] is released
May 19 18:24:10 localhost.localdomain kernel: pci_bus 0000:06: busn_res: [bus 06-39] is released
May 19 18:24:10 localhost.localdomain kernel: thunderbolt 0-1: device disconnected
May 19 18:24:12 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:12 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dbus-:1.3-org.fedoraproject.SetroubleshootPrivileged@4 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:15 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=packagekit comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:20 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:23 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=dbus-:1.3-org.fedoraproject.SetroubleshootPrivileged@4 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:23 localhost.localdomain audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
May 19 18:24:24 localhost.localdomain audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=setroubleshootd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
~~~
Vite and Kamile, Thank you for confirming the conditions. Will you also be able to follow the steps from https://bugzilla.redhat.com/show_bug.cgi?id=2186595#c3 to gather debugging data? *** Bug 2208581 has been marked as a duplicate of this bug. *** $ journalctl -f | grep -i avc
kvě 22 14:01:36 hydra audit[22029]: AVC avc: denied { map_read map_write } for pid=22029 comm="kworker/6:0" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=0
^C
$ cat /sys/kernel/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 2/2 #P:12
#
# _-----=> irqs-off/BH-disabled
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / _-=> migrate-disable
# |||| / delay
# TASK-PID CPU# ||||| TIMESTAMP FUNCTION
# | | | ||||| | |
kworker/6:0-22029 [006] ..... 10224.971061: selinux_audited: requested=0x6 denied=0x6 audited=0x6 result=-13 scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf
kworker/6:0-22029 [006] ..... 10224.971074: <stack trace>
=> trace_event_raw_event_selinux_audited
=> avc_audit_post_callback
=> common_lsm_audit
=> slow_avc_audit
=> avc_has_perm
=> security_bpf_map
=> __sys_bpf
=> kern_sys_bpf
=> skel_map_get_fd_by_id
=> hid_bpf_release_progs
=> process_one_work
=> worker_thread
=> kthread
=> ret_from_fork
Thanks! So this PR should do the trick: https://github.com/fedora-selinux/selinux-policy/pull/1698 FEDORA-2023-2663818afd has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2663818afd FEDORA-2023-2663818afd 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-2663818afd` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2663818afd See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-2663818afd has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. |
Description of problem: It happend when I plugged gamepad SELinux is preventing kworker/30:1 from map_read, map_write access on the bpf labeled kernel_t. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that 30:1 should be allowed map_read map_write access on bpf labeled kernel_t 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 'kworker/30:1' --raw | audit2allow -M my-kworker301 # semodule -X 300 -i my-kworker301.pp Additional Information: Source Context system_u:system_r:kernel_t:s0 Target Context system_u:system_r:kernel_t:s0 Target Objects Unknown [ bpf ] Source kworker/30:1 Source Path kworker/30:1 Port <Unknown> Host (removed) Source RPM Packages Target RPM Packages SELinux Policy RPM selinux-policy-targeted-38.10-1.fc39.noarch Local Policy RPM selinux-policy-targeted-38.10-1.fc39.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Permissive Host Name (removed) Platform Linux (removed) 6.3.0- 0.rc6.20230412gite62252bc55b6.51.fc39.x86_64+debug #1 SMP PREEMPT_DYNAMIC Wed Apr 12 21:55:44 +05 2023 x86_64 Alert Count 2 First Seen 2023-04-11 21:24:09 +05 Last Seen 2023-04-13 23:59:35 +05 Local ID 45da7165-9da8-4604-b616-8dc6c4287310 Raw Audit Messages type=AVC msg=audit(1681412375.280:285): avc: denied { map_read map_write } for pid=26427 comm="kworker/30:2" scontext=system_u:system_r:kernel_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=bpf permissive=1 Hash: kworker/30:1,kernel_t,kernel_t,bpf,map_read,map_write Version-Release number of selected component: selinux-policy-targeted-38.10-1.fc39.noarch Additional info: reporter: libreport-2.17.9 reason: SELinux is preventing kworker/30:1 from map_read, map_write access on the bpf labeled kernel_t. package: selinux-policy-targeted-38.10-1.fc39.noarch component: selinux-policy hashmarkername: setroubleshoot type: libreport kernel: 6.3.0-0.rc6.20230412gite62252bc55b6.51.fc39.x86_64+debug comment: It happend when I plugged gamepad component: selinux-policy