Bug 1255951 - SELinux policy prevents lircd from dropping privileges
Summary: SELinux policy prevents lircd from dropping privileges
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 22
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-22 09:11 UTC by Michael Chapman
Modified: 2016-07-19 17:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 17:37:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael Chapman 2015-08-22 09:11:39 UTC
This bug is reported against selinux-policy-targeted-3.13.1-128.10.fc22.noarch.

lircd can be configured to run as a low-privilege user through its --effective-user command-line option or effective-user config option. This is thwarted by the current SELinux targeted policy on F22, however, as it does not permit lircd to read /etc/passwd and /etc/group or call setuid() and setgid(). lircd continues to run as the root user if SELinux is enforcing.

The log message from lircd is:

  lircd-0.9.2a[15384]: Illegal effective uid: lirc: Permission denied

This is from its attempt to call getpwnam on the username "lirc" (i.e. reading /etc/passwd).

My workaround is the following custom policy:

  policy_module(my_lircd, 1.0.0)

  gen_require(`
      type lircd_t;
  ')

  auth_read_passwd(lircd_t)
  allow lircd_t self:capability { setuid setgid };

setgid() isn't used by lirc 0.9.2, but it will be by lirc 0.9.3.

Comment 1 Fedora End Of Life 2016-07-19 17:37:26 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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.