Bug 1448877 - iscsid is prevented by SELinux from loading modules
Summary: iscsid is prevented by SELinux from loading modules
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-08 13:31 UTC by alan
Modified: 2017-11-28 23:54 UTC (History)
10 users (show)

Fixed In Version: selinux-policy-3.13.1-283.17.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-28 23:54:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description alan 2017-05-08 13:31:28 UTC
Description of problem:

During start up iscsid attempts to access the iscsi kernel modules. These have not been loaded at this point but iscsid is blocked from loading them leading to an AVC error and the iscsi service coming up whtout modules loaded or disks

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

25

How reproducible:

Boot Fedora 25
Connect to an iscsi device with iscsiadm -m discovery -t st -p whateverhost
iscsiadm -m node --login

So far so good

Now 

systemctl enable iscsi

reboot with enforcing enabled

Actual results:

No volumes are loaded. Grovelling around in the logs reveals AVC errors and no modules loaded

Expected results:

iscsi volumes come online


Additional info:

Comment 1 Chris Leech 2017-05-15 17:39:21 UTC
I don't know when this stopped working, it looks like iscsid should have the sys_module capability in the selinux policy.  It wants to load kernel modules using libkmod.

I'll see about capturing some AVC errors.

Comment 2 Chris Leech 2017-05-15 17:49:49 UTC
type=AVC msg=audit(1494870037.428:169): avc:  denied  { module_load } for  pid=863 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.

type=AVC msg=audit(1494870035.664:109): avc:  denied  { module_load } for  pid=863 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.

type=AVC msg=audit(1494870035.668:110): avc:  denied  { module_load } for  pid=863 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.

type=AVC msg=audit(1494870037.426:168): avc:  denied  { module_load } for  pid=863 comm="iscsid" scontext=system_u:system_r:iscsid_t:s0 tcontext=system_u:system_r:iscsid_t:s0 tclass=system permissive=0
	Was caused by:
		Missing type enforcement (TE) allow rule.

		You can use audit2allow to generate a loadable module to allow this access.

Comment 3 Fedora End Of Life 2017-11-16 19:21:54 UTC
This message is a reminder that Fedora 25 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 25. 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 '25'.

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 25 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 4 Jeff Bastian 2017-11-16 21:55:07 UTC
This is still an issue with Fedora 27.  It doesn't look like it would take much to fix it:


~]# audit2allow -R -b -M iscsid
...

~]# cat iscsid.te
policy_module(iscsid, 1.0)

require {
	type iscsid_t;
	class system module_load;
}

#============= iscsid_t ==============
allow iscsid_t self:system module_load;
files_map_kernel_modules(iscsid_t)

Comment 5 Fedora Update System 2017-11-22 08:56:03 UTC
selinux-policy-3.13.1-283.17.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d05b1a2ab9

Comment 6 Fedora Update System 2017-11-22 21:41:48 UTC
selinux-policy-3.13.1-283.17.fc27 has been pushed to the Fedora 27 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-d05b1a2ab9

Comment 7 Fedora Update System 2017-11-28 23:54:14 UTC
selinux-policy-3.13.1-283.17.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.


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