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 1952292 - [RHEL9.0] SELinux is preventing fcoemon service
Summary: [RHEL9.0] SELinux is preventing fcoemon service
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: selinux-policy
Version: 9.0
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: beta
: 9.0 Beta
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
: 2076682 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-22 01:29 UTC by guazhang@redhat.com
Modified: 2022-04-25 14:18 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-34.1.5-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-07 21:35:16 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sosreport-storageqe-67-2021-04-23-vekmtux.tar.xz (15.80 MB, text/plain)
2021-04-24 04:28 UTC, guazhang@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1918561 1 None None None 2023-10-11 07:45:45 UTC

Description guazhang@redhat.com 2021-04-22 01:29:32 UTC
Description of problem:
found the log in message "audit[8002]: AVC avc:  denied  { add_name } for  pid=8002 comm="fcoemon" name="enabled" "

please help to check 

Version-Release number of selected component (if applicable):
RHEL-9.0.0-20210330.7 BaseOS x86_64
selinux-policy-3.14.7-23.el9.noarch

How reproducible:


Steps to Reproduce:
1. install OS and restart fcoe service 
2.
3.


https://beaker.engineering.redhat.com/recipes/9881115#task124967510,task124967515


SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      33
selinux-policy-3.14.7-23.el9.noarch
----
time->Wed Apr 21 21:03:12 2021
type=AVC msg=audit(1619053392.089:143): avc:  denied  { add_name } for  pid=8009 comm="fcoemon" name="enabled" scontext=system_u:system_r:fcoemon_t:s0 tcontext=system_u:object_r:sysfs_t:s0 tclass=dir permissive=0
----
time->Wed Apr 21 21:03:21 2021
type=AVC msg=audit(1619053401.866:164): avc:  denied  { confidentiality } for  pid=8406 comm="kexec" lockdown_reason="/proc/kcore access" scontext=system_u:system_r:kdump_t:s0 tcontext=system_u:system_r:kdump_t:s0 tclass=lockdown permissive=0

Comment 1 guazhang@redhat.com 2021-04-22 10:10:56 UTC
Hi,
Please have a look the bug

Comment 2 Steve Grubb 2021-04-23 11:00:28 UTC
This is not an audit problem. Transferring to selinux-policy.

Comment 3 Milos Malik 2021-04-23 11:52:00 UTC
The second SELinux denial is already addressed in BZ#1932752.

Comment 4 Milos Malik 2021-04-23 12:33:49 UTC
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.

Comment 5 guazhang@redhat.com 2021-04-23 13:18:57 UTC
Hi

Same question can be reproduced with RHEL8.4 
please see https://bugzilla.redhat.com/show_bug.cgi?id=1918561#c22

Comment 6 Milos Malik 2021-04-23 14:26:14 UTC
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.

Comment 7 guazhang@redhat.com 2021-04-24 03:54:51 UTC
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]#

Comment 8 guazhang@redhat.com 2021-04-24 04:28:40 UTC
Created attachment 1774975 [details]
sosreport-storageqe-67-2021-04-23-vekmtux.tar.xz

Comment 12 Zdenek Pytela 2021-05-12 13:05:03 UTC
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/734

Comment 13 Zdenek Pytela 2021-05-13 18:00:40 UTC
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

Comment 29 Zdenek Pytela 2022-04-25 14:18:09 UTC
*** Bug 2076682 has been marked as a duplicate of this bug. ***


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