Bug 1007957 - avc: denied { write } for pid=15191 comm="sleep.sh" name="sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file
Summary: avc: denied { write } for pid=15191 comm="sleep.sh" name="sleep.log" dev="...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-13 15:47 UTC by Orion Poplawski
Modified: 2013-09-16 19:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-16 19:29:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2013-09-13 15:47:40 UTC
Description of problem:

Seeing this when I close the lid on my laptop:

avc:  denied  { write } for  pid=15191 comm="sleep.sh" name="sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file

coming from /etc/acpi/actions/sleep.sh.

In permissive I get:

type=AVC msg=audit(1379087014.778:876): avc:  denied  { write } for  pid=25933 comm="sleep.sh" name="sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file
type=AVC msg=audit(1379087014.778:876): avc:  denied  { open } for  pid=25933 comm="sleep.sh" path="/var/log/sleep.log" dev="sda8" ino=792198 scontext=system_u:system_r:apmd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file

/var/log/sleep.log already existed at that point, but wouldn't necessarily on a newly installed system.


Version-Release number of selected component (if applicable):
acpid-2.0.19-6.fc19.i686
selinux-policy-3.12.1-74.3.fc19.noarch

Comment 1 Daniel Walsh 2013-09-16 18:37:17 UTC
Where does /etc/acpi/actions/sleep.sh come from, it looks like we need  label for /var/log/sleep.log

apmd_log_t

If you renamed this to /var/log/acpid.sleep.log it would be labeled correctly.

Or 

semanage fcontext -a -t apmd_log_t '/var/log/sleep\.log'
restorecon -R -v /var/log/sleep.log

Comment 2 Orion Poplawski 2013-09-16 19:29:25 UTC
Sorry, I had thought this script was part of acpid, but it is our own custom script - so we need our own policy - or use the acpid.sleep.log name - thanks for that.


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