Bug 1377451 - SELinux is preventing login from open access on the file /run/udev/data/c248:4.
Summary: SELinux is preventing login from open access on the file /run/udev/data/c248:4.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-19 17:56 UTC by Seth Jennings
Modified: 2018-12-09 20:13 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.13.1-283.32.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-27 01:17:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
sealert.log (5.77 KB, text/x-vhdl)
2016-09-19 17:56 UTC, Seth Jennings
no flags Details

Description Seth Jennings 2016-09-19 17:56:34 UTC
Created attachment 1202570 [details]
sealert.log

The U2F module for PAM is being denied access to U2F device by selinux (see attached sealert).

The following TE modification fixes the issue.

module my-login 1.0;

require {
	type local_login_t;
	type udev_var_run_t;
	class file { getattr open read };
}

#============= local_login_t ==============
allow local_login_t udev_var_run_t:file { getattr open read };

Also see:
https://bugzilla.redhat.com/show_bug.cgi?id=1283296#c16

Comment 1 Fedora Admin XMLRPC Client 2016-09-27 15:07:06 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 2 Georg Sauthoff 2017-01-04 23:12:38 UTC
I can confirm that this is still in an issue on Fedora 25.

How to reproduce:

1. insert a line like this into `/etc/pam.d/login`:

    auth requisite pam_u2f.so debug authfile=/etc/u2f_mappings interactive

before

    auth       substack     system-auth

2. Generate the content of `/etc/u2f_mappings` with the `pamu2fcfg` utility.
3. Go to a real linux console (e.g. Ctrl+Alt+F3)
4. try to login

expected results: a prompt for the U2F-key, and then successful login

actual results: a prompt for the U2F-key, some SELinux related AVC denials in the system journal and a failed login.


The old work-around still works:

     semanage permissive -a local_login_t

Comment 3 Fedora End Of Life 2017-07-25 23:08:12 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. 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 '24'.

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 24 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 Georg Sauthoff 2017-07-29 16:13:22 UTC
I can reproduce this issue on Fedora 26.

The AVCs I get (in permissive mode):

Jul 29 17:09:57 example.org audit[10736]: AVC avc:  denied  { read } for  pid=10736 comm="login" name="c247:3" dev="tmpfs" ino=20875 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
Jul 29 17:09:57 example.org audit[10736]: AVC avc:  denied  { open } for  pid=10736 comm="login" path="/run/udev/data/c247:3" dev="tmpfs" ino=20875 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
Jul 29 17:09:57 example.org audit[10736]: AVC avc:  denied  { getattr } for  pid=10736 comm="login" path="/run/udev/data/c247:3" dev="tmpfs" ino=20875 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1

As before, the old work-around still works (when SELinux is enforcing):

$ semanage permissive -a local_login_t

Comment 5 Fedora End Of Life 2017-08-08 17:28:52 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 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.

Comment 6 Gunnar Guðvarðarson 2018-04-06 00:45:21 UTC
I am affected in Fedora 27, is there a new bug report for this?

type=AVC msg=audit(1522974875.239:3188): avc:  denied  { read } for  pid=26663 comm="login" name="c245:1" dev="tmpfs" ino=1937611 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0
type=AVC msg=audit(1522974875.240:3189): avc:  denied  { read } for  pid=26663 comm="login" name="c245:0" dev="tmpfs" ino=2038831 scontext=system_u:system_r:local_login_t:s0-s0:c0.c1023 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=0

audit2allow suggests this:
allow local_login_t udev_var_run_t:file read;

I compiled the module suggested in https://bugzilla.redhat.com/show_bug.cgi?id=1283296#c22 and it works perfectly.

Comment 7 Fedora Update System 2018-04-16 11:31:51 UTC
selinux-policy-3.13.1-283.32.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-d3085b9774

Comment 8 Fedora Update System 2018-04-18 02:58:46 UTC
selinux-policy-3.13.1-283.32.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-2018-d3085b9774

Comment 9 Fedora Update System 2018-04-27 01:17:42 UTC
selinux-policy-3.13.1-283.32.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Georg Sauthoff 2018-12-09 20:13:08 UTC
I can confirm, on a fresh Fedora 29 system, I don't need to apply the `semanage permissive -a local_login_t` work-around, anymore. U2F enabled login works as expected.


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