Bug 1057612 - systemd slice systemd-logind : tclass=system perm=start - incorrect checking
systemd slice systemd-logind : tclass=system perm=start - incorrect checking
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
20
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-24 08:20 EST by stanv
Modified: 2015-06-29 20:52 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-06-29 20:52:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description stanv 2014-01-24 08:20:23 EST
Description of problem:
systemd perfoms incorrect SeLinux context checking:


[   14.778999] systemd[1]: Got D-Bus request:
org.freedesktop.systemd1.Manager.StartUnit() on /org/freedesktop/systemd1
[   14.781936] 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=start path=(null)
cmdline=(null): 0
[   14.781944] systemd[1]: Trying to enqueue job user-994.slice/start/fail
[   14.781970] systemd[1]: Installed new job user-994.slice/start as 424
[   14.781974] systemd[1]: Enqueued job user-994.slice/start as 424
[   14.782023] systemd[1]: Starting user-994.slice.
[   14.782189] systemd[1]: user-994.slice changed dead -> active
[   14.782194] systemd[1]: Job user-994.slice/start finished, result=done
[   14.782293] systemd[1]: Created slice user-994.slice. 


# rpm -q systemd
systemd-208-9.fc20.x86_64


To reproduce:
# cat /etc/systemd/system.conf | grep -Ei 'kmsg|debug'
LogLevel=debug
LogTarget=kmsg


# seinfo -csystem -x
   system
      status
      module_request
      reboot
      disable
      enable
      undefined
      ipc_info
      syslog_read
      halt
      reload
      syslog_console
      syslog_mod


class "system" doesn't have permission "start"

Above check should return "DENIED".
Comment 1 Daniel Walsh 2014-01-24 11:29:26 EST
Looks like this is fixed in selinux-policy-3.12.1-120.fc20
Comment 2 Miroslav Grepl 2014-01-24 11:37:55 EST
This is about "system" vs "service" class.

We have

   allow systemd_logind_t init_t : service status ; 
   allow systemd_domain init_t : service { start stop status reload } ;

and

  allow systemd_logind_t init_t : system { halt reboot status undefined } ;

But is has been fixed in RHEL7.
Comment 3 Daniel Walsh 2014-01-24 11:43:28 EST
Ok why not just allow it for F20 for now and clean it up in F21.
Comment 4 stanv 2014-01-26 13:41:38 EST
Please point me the commit fixing this bug.

I do not understand, why FC20 results in "ALLOW" for this action.
It is unknown action "start" for "system" class. Why SeLinux results "ALLOW"?


My system (ALT Linux distro) returns "DENIED". I don't understand this behaviour.
Comment 5 Miroslav Grepl 2014-01-27 02:10:09 EST
(In reply to Daniel Walsh from comment #1)
> Looks like this is fixed in selinux-policy-3.12.1-120.fc20

Because there was a bug and we removed 

{start stop status reload}

permissions for system class. I meant it had been fixed in systemd on RHEL7.
Comment 6 Miroslav Grepl 2014-01-28 02:40:10 EST
Why has it been changed to policy?

It means I will need to add back 

{start stop status reload}

for "system" class which is wrong.
Comment 7 Lennart Poettering 2014-01-28 11:43:52 EST
Well, this is for session objects. I am not sure what other class you want me to use for that...
Comment 8 Miroslav Grepl 2014-01-28 11:57:30 EST
And do we have all el7 fixes? If I am OK we see "service" class on RHEL7.
Comment 9 Fedora End Of Life 2015-05-29 06:39:42 EDT
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 '20'.

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 20 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 10 Fedora End Of Life 2015-06-29 20:52:18 EDT
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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.