Bug 822789

Summary: avc denial on systemd-journald prevents startup when /etc/machine-id doesn't exist
Product: [Fedora] Fedora Reporter: vt
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-03 23:30:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vt 2012-05-18 07:16:52 UTC
Description of problem:
If the /etc/machine-id file doesn't exist, systemd installs a temporary machine-id file which is bind-mounted to /run/systemd/machine-id. Because of this, it has the wrong context (system_u:object_r:init_var_run_t:s0 instead of system_u:object_r:etc_runtime_t:s0), which prevents systemd-journald from starting.

Version-Release number of selected component (if applicable):
3.10.0-125.fc17

How reproducible:
Always, when systemd is enforcing

Steps to Reproduce:
1. Remove /etc/machine-id
2. Reboot

Actual results:
Machine starts up normally.

Expected results:
systemd enters emergency mode because of systemd-journal failure.

Additional info:

type=PATH msg=audit(1337324051.472:101): item=0 name="/etc/machine-id" inode=410 dev=00:10 mode=0100644 ouid=0 ogid=0 rdev=00:00 obj=system_u:object_r:init_var_run_t:s0
type=CWD msg=audit(1337324051.472:101):  cwd="/"
type=SYSCALL msg=audit(1337324051.472:101): arch=40000003 syscall=5 success=yes exit=8 a0=8064600 a1=88100 a2=0 a3=bfe28944 items=1 ppid=1 pid=854 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemd-journal" exe="/usr/lib/systemd/systemd-journald" subj=system_u:system_r:syslogd_t:s0 key=(null)
type=AVC msg=audit(1337324051.472:101): avc:  denied  { open } for  pid=854 comm="systemd-journal" dev="tmpfs" ino=410 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file
type=AVC msg=audit(1337324051.472:101): avc:  denied  { read } for  pid=854 comm="systemd-journal" dev="tmpfs" ino=410 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=file

Comment 1 Daniel Walsh 2012-05-18 17:36:25 UTC
Fixed in selinux-policy-3.10.0-126.fc17

Comment 2 Fedora Update System 2012-05-31 06:25:15 UTC
selinux-policy-3.10.0-128.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-128.fc17

Comment 3 Fedora Update System 2012-06-01 17:07:50 UTC
Package selinux-policy-3.10.0-128.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-128.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8720/selinux-policy-3.10.0-128.fc17
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-06-03 23:30:27 UTC
selinux-policy-3.10.0-128.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.