Bug 921456 - Write to random-seed and wtmp fails due to selinux policy
Summary: Write to random-seed and wtmp fails due to selinux policy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-14 09:12 UTC by Václav Pavlín
Modified: 2013-04-11 23:34 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-04-11 23:34:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
journalctl output with selinux messages (5.18 KB, text/x-log)
2013-03-14 09:12 UTC, Václav Pavlín
no flags Details

Description Václav Pavlín 2013-03-14 09:12:04 UTC
Created attachment 709928 [details]
journalctl output with selinux messages

Description of problem:
When using readonly-root feature selinux prevents writing to /var/lib/random-seed and /var/log/wtmp

Version-Release number of selected component (if applicable):
selinux-policy-3.11.1-66.fc18

How reproducible:
always

Steps to Reproduce:
1. Enable readonly root function in /etc/sysconfig/readonly-root file, set READONLY=yes and TEMPORARY_STATE=yes.
2. Add mount option ro in /etc/fstab for / directory.
3. Reboot
4. See output of journalctl | grep random-seed and journalctl | grep wtmp
  
Actual results:
Mar 14 09:58:58 localhost.localdomain kernel: type=1400 audit(1363251538.446:4): avc:  denied  { mounton } for  pid=388 comm="mount" path="/var/lib/random-seed" dev="dm-1" ino=141188 scontext=system
...
Mar 14 09:58:58 localhost.localdomain kernel: type=1400 audit(1363251538.721:6): avc:  denied  { read } for  pid=427 comm="systemd-tmpfile" name="config" dev="dm-1" ino=15994 scontext=system_u:syste



Expected results:
Write to /var/lib/random-seed succeeds.

Additional info:

Comment 1 Miroslav Grepl 2013-03-14 10:37:46 UTC
Vaclav, 
any change to get complete AVC msgs from audit.log?

Comment 2 Václav Pavlín 2013-03-14 11:00:00 UTC
Mar 14 11:52:04 localhost.localdomain kernel: type=1400 audit(1363258324.516:4): avc:  denied  { mounton } for  pid=412 comm="mount" path="/var/lib/random-seed" dev="dm-1" ino=141188 scontext=system_u:system_r:mount_t:s0 tcontext=system_u:object_r:random_seed_t:s0 tclass=file

Mar 14 11:52:04 localhost.localdomain kernel: type=1400 audit(1363258324.517:5): avc:  denied  { mounton } for  pid=412 comm="mount" path="/var/lib/random-seed" dev="dm-1" ino=141188 scontext=system_u:system_r:mount_t:s0 tcontext=system_u:object_r:random_seed_t:s0 tclass=file

Mar 14 11:52:04 localhost.localdomain kernel: type=1400 audit(1363258324.738:7): avc:  denied  { create } for  pid=444 comm="systemd-tmpfile" name="wtmp" scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=system_u:object_r:wtmp_t:s0 tclass=file

Comment 3 Daniel Walsh 2013-03-15 16:57:59 UTC
commit 67598ef5a5e8b1e7f87dce14b21005f7cea386f7 fixes this in Rawhide.

Comment 4 Miroslav Grepl 2013-03-18 09:26:04 UTC
Back ported.

commit 96bdc5b872b3c7dd3e4223e2c437536ae33b6cc2
Author: Dan Walsh <dwalsh>
Date:   Fri Mar 15 12:57:02 2013 -0400

    Allow sytemd_tmpfiles to create wtmp file

Comment 5 Fedora Update System 2013-03-21 18:25:25 UTC
selinux-policy-3.11.1-87.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-87.fc18

Comment 6 Fedora Update System 2013-03-22 21:12:28 UTC
Package selinux-policy-3.11.1-87.fc18:
* should fix your issue,
* was pushed to the Fedora 18 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.11.1-87.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-4251/selinux-policy-3.11.1-87.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-04-11 23:34:25 UTC
selinux-policy-3.11.1-87.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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