Bug 1027148 - avc: denied { setattr } for pid=183 comm="systemd-tmpfile" during boot
avc: denied { setattr } for pid=183 comm="systemd-tmpfile" during boot
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-06 04:39 EST by Vitaly Kuznetsov
Modified: 2014-02-12 09:44 EST (History)
14 users (show)

See Also:
Fixed In Version: selinux-policy-3.12.1-122.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-12 09:44:21 EST
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 Vitaly Kuznetsov 2013-11-06 04:39:24 EST
Description of problem:

I'm seeing the following in /var/log/messages:
# grep "avc.*denied" /var/log/messages 
Nov  6 09:19:41 ip-10-62-83-156 kernel: [399654.738880] type=1400 audit(1383729579.090:4): avc:  denied  { setattr } for  pid=183 comm="systemd-tmpfile" name="journal" dev="xvda1" ino=255451 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir
Nov  6 09:19:41 ip-10-62-83-156 kernel: [399654.738953] type=1400 audit(1383729579.090:5): avc:  denied  { setattr } for  pid=183 comm="systemd-tmpfile" name="7bd3c66a3d974c51b7a407a5bd3073b9" dev="xvda1" ino=385758 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir

[root@ip-10-62-83-156 ~]# find /var/log/ -inum 255451
/var/log/journal
[root@ip-10-62-83-156 ~]# find /var/log/ -inum 385758
/var/log/journal/7bd3c66a3d974c51b7a407a5bd3073b9

Version-Release number of selected component (if applicable):
systemd-208-4.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
I've done my testing for F20-Beta-RC4 AMI on EC2 only, but should be reproducible on bare metal as well 

1. Start F20-Beta-RC4 AMI on EC2
2. Do 'yum update'
3. Reboot

Actual results:
avc: denied messages

Expected results:
no denials

Additional info:
Comment 1 Vitaly Kuznetsov 2013-11-06 04:52:09 EST
I can also see:
Nov  6 09:19:40 ip-10-62-83-156 systemd-tmpfiles: chmod(/var/log/journal) failed: Permission denied
Nov  6 09:19:40 ip-10-62-83-156 systemd-tmpfiles: chmod(/var/log/journal/7bd3c66a3d974c51b7a407a5bd3073b9) failed: Permission denied

in /var/log/messages
Comment 3 Peter Lemenkov 2013-11-07 05:38:31 EST
Confirm that. I have to add the following rule:

https://github.com/lemenkov/selinux-rules/blob/master/auriga-systemd-tmpfiles.te

module auriga-systemd-tmpfiles 1.0;

require {
        type systemd_tmpfiles_t;
        type var_log_t;
        class dir { relabelfrom relabelto setattr };
}

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t var_log_t:dir { relabelfrom relabelto setattr };
Comment 4 Zbigniew Jędrzejewski-Szmek 2013-11-15 17:22:48 EST
Hm, I get a slightly simpler result from audit2allow:

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t var_log_t:dir setattr;

Either way, can we get this applied? This results in an annoying warning for probably all F20 installations?
Comment 5 Zbigniew Jędrzejewski-Szmek 2013-11-15 17:23:44 EST
systemd changed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=4608af43.
Comment 6 Alexander Todorov 2013-11-19 04:30:48 EST
Seen here:
http://beaker.fedoraproject.org/bkr/jobs/51

will re-test with the latest.
Comment 7 Daniel Walsh 2014-01-23 09:30:59 EST
Looks like the latest code in F20 allows this.

selinux-policy-3.12.1-120.fc20 or earlier.
Comment 8 Fedora Update System 2014-01-27 14:16:17 EST
selinux-policy-3.12.1-121.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-121.fc20
Comment 9 Fedora Update System 2014-01-28 22:06:26 EST
Package selinux-policy-3.12.1-121.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.12.1-121.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1700/selinux-policy-3.12.1-121.fc20
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2014-01-29 22:32:29 EST
Package selinux-policy-3.12.1-122.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.12.1-122.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1700/selinux-policy-3.12.1-122.fc20
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2014-02-12 09:44:21 EST
selinux-policy-3.12.1-122.fc20 has been pushed to the Fedora 20 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.