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
avc: denied { write } for pid=15191 comm="sleep.sh" name="sleep.log" dev="...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
19
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-13 11:47 EDT by Orion Poplawski
Modified: 2013-09-16 15:29 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-16 15:29:25 EDT
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 Orion Poplawski 2013-09-13 11:47:40 EDT
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 14:37:17 EDT
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 15:29:25 EDT
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.