Bug 1476015 - If mcstrans is active, systemd-logind fails to start
Summary: If mcstrans is active, systemd-logind fails to start
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libselinux
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-27 20:33 UTC by Göran Uddeborg
Modified: 2019-05-28 23:58 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-28 23:58:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Göran Uddeborg 2017-07-27 20:33:13 UTC
Description of problem:
Since some time back, two of our machines have had problems booting.  Some of the time the systemd-logind services fails with an error message, other times it works.

I've tried to understand what is going on for quite some time.  To make a long story short, I see what I believe is a problem in libselinux.

The problem systemd-logind encounters is an SELinux denial when talking via DBus with systemd itself.  If the mcstrans.service starts up before systemd-logind.service, the following check is logged by systemd:

jul 27 20:38:05 freddi systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:SystemLow tcon=system_u:system_r:init_t:s0 tclass=system perm=status path=(null) cmdline=/usr/lib/systemd/systemd-logind: -13

Note in particular, that the source context has "SystemLow" as its category, while the target context has "s0".  As can be seen, this check fails (-13), the request from systemd-logind is denied, and the service fails.  If, on the other hand, systemd-logind gets started before mcstrans, then the check looks like this:

jul 27 20:39:05 freddi systemd[1]: SELinux access check scon=system_u:system_r:systemd_logind_t:s0 tcon=system_u:system_r:init_t:s0 tclass=system perm=status path=(null) cmdline=/usr/lib/systemd/systemd-logind: 0

Here, the source context also has "s0" as its category, and then the access is allowed (0).  Systemd-logind starts as expected.

The check is implemented as a call of selinux_check_access.

What makes me believe this is a bug in libselinux is that "s0" and "SystemLow" are actually the same thing.  Thus, I would have expected the call of selinux_check_access would give the same result regardless of which notation is being used.

That said, I don't fully understand what is going on here.  I tried to create a simple reproducible case, a small program only calling selinux_check_access with the two contexts.  That DOES work as expected, it accepts a combination of SystemLow and s0 in its arguments.  There is something special in the context of systemd (pid==1) which makes it fail there, but I'm not clear on what.

Have I perhaps misunderstood things?

Comment 1 Fedora End Of Life 2018-05-03 08:33:18 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 '26'.

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 26 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 2 Göran Uddeborg 2018-05-14 13:03:48 UTC
Appears to still be a problem in F28.

Comment 3 Ben Cotton 2019-05-02 19:37:25 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. 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 '28'.

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 28 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 Ben Cotton 2019-05-28 23:58:35 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 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.