Bug 1952292
Summary: | [RHEL9.0] SELinux is preventing fcoemon service | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | guazhang <guazhang> | ||||
Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Milos Malik <mmalik> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 9.0 | CC: | cleech, lvrabec, mmalik, plautrba, sgrubb, ssekidde, zpytela | ||||
Target Milestone: | beta | Keywords: | Triaged | ||||
Target Release: | 9.0 Beta | ||||||
Hardware: | Unspecified | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | selinux-policy-34.1.5-1.el9 | Doc Type: | No Doc Update | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2021-12-07 21:35:16 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: | |||||||
Attachments: |
|
Description
guazhang@redhat.com
2021-04-22 01:29:32 UTC
Hi, Please have a look the bug This is not an audit problem. Transferring to selinux-policy. The second SELinux denial is already addressed in BZ#1932752. I rescheduled the beaker job mentioned in comment#0 and added one of selinux-policy TCs which deals with the fcoe service: If everything goes well, we will see complete SELinux denials. Hi Same question can be reproduced with RHEL8.4 please see https://bugzilla.redhat.com/show_bug.cgi?id=1918561#c22 I don't have access to machines with FCoE HW, which means that I cannot re-run the same tests in permissive mode. If this bug should be fixed completely, we need to see SELinux denials triggered by these tests when they are executed in permissive mode. Could you re-run the same commands as mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1918561#c22 in permissive mode? # setenforce 0 # fcoeadm ... # fcoeadm ... # ausearch -m avc -m user_avc -m selinux_err -i -ts today Please attach the whole output from ausearch command to the bug report. hi [root@storageqe-67 reboot_fcoe_service]# fcoeadm -d ens2f0200 [root@storageqe-67 reboot_fcoe_service]# fcoeadm -c ens2f0200 [root@storageqe-67 reboot_fcoe_service]# setenforce 0 [root@storageqe-67 reboot_fcoe_service]# fcoeadm -d ens2f0200 [root@storageqe-67 reboot_fcoe_service]# fcoeadm -c ens2f0200 [root@storageqe-67 reboot_fcoe_service]# [root@storageqe-67 reboot_fcoe_service]# ausearch -m avc -m user_avc -m selinux_err -i -ts today ---- type=AVC msg=audit(04/23/21 23:44:48.802:317) : avc: denied { add_name } for pid=13820 comm=fcoemon name=ctlr_destroy scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0 ---- type=AVC msg=audit(04/23/21 23:44:58.838:320) : avc: denied { add_name } for pid=13820 comm=fcoemon name=enabled scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0 ---- type=AVC msg=audit(04/23/21 23:46:07.822:324) : avc: denied { add_name } for pid=13820 comm=fcoemon name=enabled scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1 ---- type=AVC msg=audit(04/23/21 23:46:07.822:325) : avc: denied { create } for pid=13820 comm=fcoemon name=enabled scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=1 [root@storageqe-67 reboot_fcoe_service]# Apr 23 23:46:12 storageqe-67 setroubleshoot[14289]: SELinux is preventing fcoemon from add_name access on the directory enabled. For complete SELinux messages run: sealert -l 85e0f64c-97e8-4ada-98ff-e97edd940530 Apr 23 23:46:12 storageqe-67 setroubleshoot[14289]: SELinux is preventing fcoemon from add_name access on the directory enabled.#012#012***** Plugin catchall (100. confidence) suggests **************************#012#012If you believe that fcoemon should be allowed add_name access on the enabled directory by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# ausearch -c 'fcoemon' --raw | audit2allow -M my-fcoemon#012# semodule -X 300 -i my-fcoemon.pp#012 Apr 23 23:46:12 storageqe-67 setroubleshoot[14289]: SELinux is preventing fcoemon from create access on the file enabled. For complete SELinux messages run: sealert -l c95cbd0d-64a9-4ff2-bcfb-38f45df11cc5 Apr 23 23:46:12 storageqe-67 setroubleshoot[14289]: SELinux is preventing fcoemon from create access on the file enabled.#012#012***** Plugin catchall (100. confidence) suggests **************************#012#012If you believe that fcoemon should be allowed create access on the enabled file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# ausearch -c 'fcoemon' --raw | audit2allow -M my-fcoemon#012# semodule -X 300 -i my-fcoemon.pp#012 [root@storageqe-67 reboot_fcoe_service]# sealert -l c95cbd0d-64a9-4ff2-bcfb-38f45df11cc5 SELinux is preventing fcoemon from create access on the file enabled. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that fcoemon should be allowed create access on the enabled file 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 'fcoemon' --raw | audit2allow -M my-fcoemon # semodule -X 300 -i my-fcoemon.pp Additional Information: Source Context system_u:system_r:fcoemon_t:s0 Target Context system_u:object_r:sysfs_t:s0 Target Objects enabled [ file ] Source fcoemon Source Path fcoemon Port <Unknown> Host storageqe-67.rhts.eng.pek2.redhat.com Source RPM Packages Target RPM Packages SELinux Policy RPM selinux-policy-targeted-3.14.7-23.el9.noarch Local Policy RPM selinux-policy-targeted-3.14.7-23.el9.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Permissive Host Name storageqe-67.rhts.eng.pek2.redhat.com Platform Linux storageqe-67.rhts.eng.pek2.redhat.com 5.11.0-2.el9.x86_64 #1 SMP Wed Mar 10 14:55:23 EST 2021 x86_64 x86_64 Alert Count 1 First Seen 2021-04-23 23:46:07 EDT Last Seen 2021-04-23 23:46:07 EDT Local ID c95cbd0d-64a9-4ff2-bcfb-38f45df11cc5 Raw Audit Messages type=AVC msg=audit(1619235967.822:325): avc: denied { create } for pid=13820 comm="fcoemon" name="enabled" scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=file permissive=1 Hash: fcoemon,fcoemon_t,sysfs_t,file,create [root@storageqe-67 reboot_fcoe_service]# ausearch -c 'fcoemon' --raw | audit2allow -M my-fcoemon ******************** IMPORTANT *********************** To make this policy package active, execute: semodule -i my-fcoemon.pp [root@storageqe-67 reboot_fcoe_service]# semodule -i my-fcoemon.pp libsemanage.semanage_direct_install_info: Overriding my-fcoemon module at lower priority 300 with module at priority 400. [root@storageqe-67 reboot_fcoe_service]# [root@storageqe-67 reboot_fcoe_service]# sealert -l 85e0f64c-97e8-4ada-98ff-e97edd940530 SELinux is preventing fcoemon from add_name access on the directory enabled. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that fcoemon should be allowed add_name access on the enabled 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 'fcoemon' --raw | audit2allow -M my-fcoemon # semodule -X 300 -i my-fcoemon.pp Additional Information: Source Context system_u:system_r:fcoemon_t:s0 Target Context system_u:object_r:sysfs_t:s0 Target Objects enabled [ dir ] Source fcoemon Source Path fcoemon Port <Unknown> Host storageqe-67.rhts.eng.pek2.redhat.com Source RPM Packages Target RPM Packages SELinux Policy RPM selinux-policy-targeted-3.14.7-23.el9.noarch Local Policy RPM selinux-policy-targeted-3.14.7-23.el9.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Permissive Host Name storageqe-67.rhts.eng.pek2.redhat.com Platform Linux storageqe-67.rhts.eng.pek2.redhat.com 5.11.0-2.el9.x86_64 #1 SMP Wed Mar 10 14:55:23 EST 2021 x86_64 x86_64 Alert Count 3 First Seen 2021-04-23 23:44:48 EDT Last Seen 2021-04-23 23:46:07 EDT Local ID 85e0f64c-97e8-4ada-98ff-e97edd940530 Raw Audit Messages type=AVC msg=audit(1619235967.822:324): avc: denied { add_name } for pid=13820 comm="fcoemon" name="enabled" scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=1 Hash: fcoemon,fcoemon_t,sysfs_t,dir,add_name [root@storageqe-67 reboot_fcoe_service]# ausearch -c 'fcoemon' --raw | audit2allow -M my-fcoemon ******************** IMPORTANT *********************** To make this policy package active, execute: semodule -i my-fcoemon.pp [root@storageqe-67 reboot_fcoe_service]# semodule -X 300 -i my-fcoemon.pp [root@storageqe-67 reboot_fcoe_service]# [root@storageqe-67 reboot_fcoe_service]# Created attachment 1774975 [details]
sosreport-storageqe-67-2021-04-23-vekmtux.tar.xz
I've submitted a Fedora PR to address the issue: https://github.com/fedora-selinux/selinux-policy/pull/734 Merged in rawhide: commit f89885fd6f076ef1c3d83c1d1cc981b784e2ea5e (HEAD -> rawhide, upstream/rawhide) Author: Zdenek Pytela <zpytela> Date: Wed May 12 10:19:04 2021 +0200 Allow fcoemon create sysfs files This permission is required when fcoemon wants to write to the /sys/bus/fcoe/devices/ctlr_X/enabled file and this file does not exist. Resolves: rhbz#1952292 *** Bug 2076682 has been marked as a duplicate of this bug. *** |