Bug 1427797 - SELinux is preventing iscsid from 'module_load' accesses on the system Unknown.
Summary: SELinux is preventing iscsid from 'module_load' accesses on the system Unknown.
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: iscsi
Version: 27
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Chris Leech
QA Contact: Brock Organ
URL:
Whiteboard: abrt_hash:fd7d4e72b2897fdf92cfc273678...
: 1471316 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-01 09:17 UTC by Dr. David Alan Gilbert
Modified: 2018-11-30 22:33 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:33:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dr. David Alan Gilbert 2017-03-01 09:17:38 UTC
Description of problem:
Happened during boot; it's worked fine for ages so it must be a recent package update.
I've had iscsi setup for ages but rarely use it.
SELinux is preventing iscsid from 'module_load' accesses on the system Unknown.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that iscsid should be allowed module_load access on the Unknown system 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 'iscsid' --raw | audit2allow -M my-iscsid
# semodule -X 300 -i my-iscsid.pp

Additional Information:
Source Context                system_u:system_r:iscsid_t:s0
Target Context                system_u:system_r:iscsid_t:s0
Target Objects                Unknown [ system ]
Source                        iscsid
Source Path                   iscsid
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.10.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.9.11-200.fc25.x86_64 #1 SMP Mon
                              Feb 20 18:11:59 UTC 2017 x86_64 x86_64
Alert Count                   6
First Seen                    2017-03-01 09:02:39 GMT
Last Seen                     2017-03-01 09:03:08 GMT
Local ID                      f05622fe-50b4-4a4b-9540-b2f32d25de17

Raw Audit Messages
type=AVC msg=audit(1488358988.13:241): avc:  denied  { module_load } for  pid=1090 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0


Hash: iscsid,iscsid_t,iscsid_t,system,module_load

Version-Release number of selected component:
selinux-policy-3.13.1-225.10.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.9.11-200.fc25.x86_64
type:           libreport

Comment 1 John Florian 2017-03-06 14:05:07 UTC
I can confirm this as a regular user of iscsid.  All was fine until selinux-policy-targeted-3.13.1-225.11.fc25.noarch was installed.

Comment 2 charles profitt 2017-03-20 18:45:43 UTC
I can confirm this as well. 

AVC avc: denied { module_load } for pid=1146 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0

Comment 3 Francesco Simula 2017-03-21 14:34:43 UTC
Same thing here, with identical message from sealert; I temporarily resorted to setting Selinux to 'permissive'.

Comment 4 Raffael Luthiger 2017-05-01 19:54:41 UTC
Description of problem:
Since I installed/configured iscsid I get this error whenerver I have a network connection.


Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.10.12-200.fc25.x86_64
type:           libreport

Comment 5 Mircea Vutcovici 2017-05-10 02:15:50 UTC
Description of problem:
Installed iscsi-initiator-utils
Restarted the laptop.
The following error was recorded in /var/log/audit/audit.log
type=AVC msg=audit(1494381929.458:317): avc:  denied  { module_load } for  pid=1
167 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:syste
m_r:iscsid_t:s0 tclass=system permissive=0
type=AVC msg=audit(1494381929.486:318): avc:  denied  { module_load } for  pid=1
167 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:syste
m_r:iscsid_t:s0 tclass=system permissive=0

# ausearch -c 'iscsid'
----
time->Wed May  3 20:45:56 2017
type=AVC msg=audit(1493858756.477:122): avc:  denied  { module_load } for  pid=1279 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
----

Version-Release number of selected component:
selinux-policy-3.13.1-225.13.fc25.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.10.13-200.fc25.x86_64
type:           libreport

Comment 6 Fedora Update System 2017-05-15 21:17:55 UTC
selinux-policy-3.13.1-225.16.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-9a20533d62

Comment 7 Fedora Update System 2017-05-17 01:07:37 UTC
selinux-policy-3.13.1-225.16.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-9a20533d62

Comment 8 Fedora Update System 2017-05-19 23:02:27 UTC
selinux-policy-3.13.1-225.16.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Francesco Simula 2017-07-13 09:42:04 UTC
Not working for me, even with latest selinux-policy (3.13.1-225.18):

[cut]
lug 13 11:39:25 helios systemd[1]: Starting Login and scanning of iSCSI devices...
-- Subject: Unit iscsi.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit iscsi.service has begun starting up.
lug 13 11:39:25 helios iscsi-mark-root-nodes[1705]: iscsiadm: No active sessions.
lug 13 11:39:25 helios audit[1601]: AVC avc:  denied  { module_load } for  pid=1601 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
lug 13 11:39:25 helios iscsiadm[1709]: iscsiadm: Could not login to [iface: default, target: iqn.2004-04.com.qnap:ts-419uii:iscsi.backape.cd056a, portal: 10.0.0.176,3260].
lug 13 11:39:25 helios iscsiadm[1709]: iscsiadm: initiator reported error (12 - iSCSI driver not found. Please make sure it is loaded, and retry the operation)
lug 13 11:39:25 helios iscsiadm[1709]: iscsiadm: Could not log into all portals
lug 13 11:39:25 helios iscsiadm[1709]: Logging in to [iface: default, target: iqn.2004-04.com.qnap:ts-419uii:iscsi.backape.cd056a, portal: 10.0.0.176,3260] (multiple)
lug 13 11:39:25 helios systemd[1]: Started Login and scanning of iSCSI devices.
-- Subject: Unit iscsi.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit iscsi.service has finished starting up.
-- 
-- The start-up result is done.
lug 13 11:39:25 helios audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=iscsi comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
lug 13 11:39:25 helios sudo[1702]: pam_unix(sudo:session): session closed for user root
lug 13 11:39:25 helios audit[1702]: USER_END pid=1702 uid=0 auid=10027 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin
lug 13 11:39:25 helios audit[1702]: CRED_DISP pid=1702 uid=0 auid=10027 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/0 res=succes
lug 13 11:39:25 helios iscsid[1600]: Could not insert module tcp. Kmod error -13
[/cut]

Still needs setting SELinux to 'permissive' to work...

Comment 10 Tomasz Torcz 2017-08-01 15:33:03 UTC
I see this problem on rawhide (f27). Should the bug be reopened or new one created?

Comment 11 Francesco Simula 2017-08-22 10:00:21 UTC
Still not working, on Fedora 25:

[cut]
SELinux is preventing iscsid from module_load access on the system Unknown.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that iscsid should be allowed module_load access on the Unknown system 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 'iscsid' --raw | audit2allow -M my-iscsid
# semodule -X 300 -i my-iscsid.pp


Additional Information:
Source Context                system_u:system_r:iscsid_t:s0
Target Context                system_u:system_r:iscsid_t:s0
Target Objects                Unknown [ system ]
Source                        iscsid
Source Path                   iscsid
Port                          <Unknown>
Host                          localhost
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-225.19.fc25.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain
                              4.11.12-200.fc25.x86_64 #1 SMP Fri Jul 21 16:41:43
                              UTC 2017 x86_64 x86_64
Alert Count                   27
First Seen                    2017-03-21 14:18:01 CET
Last Seen                     2017-08-22 11:51:48 CEST
Local ID                      3b1ede19-a617-48bb-a1a5-160b9257d636

Raw Audit Messages
type=AVC msg=audit(1503395508.915:174): avc:  denied  { module_load } for  pid=951 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0


Hash: iscsid,iscsid_t,iscsid_t,system,module_load
[/cut]

Comment 12 Daniel Walsh 2017-08-22 10:24:01 UTC
Why is iscsid loading a kernel module.  This seems to be a dangerous thing to do. Allowing a process to load kernel modules, means they are basically unconfined, since they can load a kernel module that could stop SELinux from enforcing.  Can't the loading of the module be done in the systemd unit file outside of the main process running the daemon?

Comment 13 Tomasz Torcz 2017-08-22 10:27:30 UTC
Can the policy be limited to allow loading 'iscsi_tcp' and 'iscsi_ibft' modules only?

Comment 14 Daniel Walsh 2017-08-22 10:28:58 UTC
Sorry no.

Comment 15 Francesco Simula 2017-11-02 16:00:07 UTC
Is there no other solution besides disabling SELinux or setting it to permissive?

Comment 16 Tomasz Torcz 2017-11-02 16:10:06 UTC
Francesco,

echo iscsi_tcp >> /etc/modules-load.d/iscsi.conf

Comment 17 Francesco Simula 2017-11-02 17:53:11 UTC
(In reply to Tomasz Torcz from comment #16)
> Francesco,
> 
> echo iscsi_tcp >> /etc/modules-load.d/iscsi.conf

Many thanks, it works for me.

Comment 18 Michael Watters 2018-01-05 16:33:16 UTC
This is still a problem as of Fedora 27.  The default SELinux policies do not allow the iscsid process to load the modules needed which causes iscsi targets to be unavailable after rebooting a server.

For example, the audit logs show failures as follows.

type=AVC msg=audit(1515168544.778:228): avc:  denied  { map } for  pid=1673 comm="iscsid" path="/usr/lib/modules/4.14.11-300.fc27.x86_64/modules.dep.bin" dev="md126" ino=805428070 scontext=system_u:system_r:iscsid_t:s0 tcontext=unconfined_u:object_r:modules_object_t:s0 tclass=file permissive=0
type=AVC msg=audit(1515168544.780:229): avc:  denied  { module_load } for  pid=1673 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0

I've verified that the workaround posted by Tomasz works.  Would it be possible to update the iscsi-initiator-tools package to create this file by default?

Comment 19 Lukas Vrabec 2018-01-08 12:16:48 UTC
Because of comment#18 moving to iscsi component.

Comment 20 Travis Michette 2018-01-10 03:20:17 UTC
(In reply to Michael Watters from comment #18)
> This is still a problem as of Fedora 27.  The default SELinux policies do
> not allow the iscsid process to load the modules needed which causes iscsi
> targets to be unavailable after rebooting a server.
> 
> For example, the audit logs show failures as follows.
> 
> type=AVC msg=audit(1515168544.778:228): avc:  denied  { map } for  pid=1673
> comm="iscsid"
> path="/usr/lib/modules/4.14.11-300.fc27.x86_64/modules.dep.bin" dev="md126"
> ino=805428070 scontext=system_u:system_r:iscsid_t:s0
> tcontext=unconfined_u:object_r:modules_object_t:s0 tclass=file permissive=0
> type=AVC msg=audit(1515168544.780:229): avc:  denied  { module_load } for 
> pid=1673 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0
> tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
> 
> I've verified that the workaround posted by Tomasz works.  Would it be
> possible to update the iscsi-initiator-tools package to create this file by
> default?

I can also confirm that this functionality still exists in FC27 with the latest set up updates.
type=AVC msg=audit(1515537967.451:285): avc:  denied  { module_load } for  pid=1572 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
type=AVC msg=audit(1515537967.575:296): avc:  denied  { map } for  pid=1572 comm="iscsid" path="/usr/lib/modules/4.14.11-300.fc27.x86_64/modules.dep.bin" dev="dm-0" ino=134320577 scontext=system_u:system_r:iscsid_t:s0 tcontext=unconfined_u:object_r:modules_object_t:s0 tclass=file permissive=0
type=AVC msg=audit(1515537967.578:297): avc:  denied  { module_load } for  pid=1572 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0


type=AVC msg=audit(1515553952.671:351): avc:  denied  { module_load } for  pid=1572 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=1
type=USER_AVC msg=audit(1515553965.574:359): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='avc:  received setenforce notice (enforcing=0)  exe="/usr/lib/systemd/systemd" sauid=0 hostname=? addr=? terminal=?

Comment 21 Lukas Vrabec 2018-03-12 13:22:54 UTC
*** Bug 1471316 has been marked as a duplicate of this bug. ***

Comment 22 Chris Leech 2018-03-13 17:14:23 UTC
(In reply to Michael Watters from comment #18)
> I've verified that the workaround posted by Tomasz works.  Would it be
> possible to update the iscsi-initiator-tools package to create this file by
> default?

There are a number of iSCSI transport driver modules that might be needed.  Some are device independent (iscsi_tcp, iser), while others are PCI drivers (be2iscsi, qla4xxx, qedi), and some are device specific drivers that stack on an Ethernet driver without having it's own PCI function to match on (be2iscsi, cxgb3i, cxgb4i).

We can't just load iscsi_tcp, as iscsid attempts to load the appropriate transport module when it's encountered in the configuration.

Comment 23 Graham Leggett 2018-05-28 10:18:50 UTC
I'm seeing these symptoms on a brand new CentOS 7 install - iscsi refuses to survive a reboot unless selinux is disabled.

Comment 24 Jan Kurik 2018-05-31 09:11:53 UTC
This bug is currently reported against a Fedora version which is already unsuported.
I am changing the version to '27', the latest supported release.

Please check whether this bug is still an issue on the '27' release.
If you find this bug not being applicable on this release, please close it.

Comment 25 Dr. David Alan Gilbert 2018-05-31 09:13:57 UTC
(In reply to Jan Kurik from comment #24)
> This bug is currently reported against a Fedora version which is already
> unsuported.
> I am changing the version to '27', the latest supported release.
> 
> Please check whether this bug is still an issue on the '27' release.
> If you find this bug not being applicable on this release, please close it.

It still does it on f28 for me:

May 31 09:01:26 dgilbert-t530 python3[2677]: SELinux is preventing iscsid from module_load access on the system Unknown.
                                             If you believe that iscsid should be allowed module_load access on the Unknown system by default.
                                             # ausearch -c 'iscsid' --raw | audit2allow -M my-iscsid
                                             # semodule -X 300 -i my-iscsid.pp

Comment 26 Ben Cotton 2018-11-27 14:37:58 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. 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 Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 27 Ben Cotton 2018-11-30 22:33:26 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 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 please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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.