Bug 1278747 - SELinux file context pattern for /var/run/qga.state is incorrect
Summary: SELinux file context pattern for /var/run/qga.state is incorrect
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.7
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
Depends On:
TreeView+ depends on / blocked
Reported: 2015-11-06 10:52 UTC by Milos Malik
Modified: 2016-09-02 13:16 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.7.19-282.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-05-10 20:02:23 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0763 0 normal SHIPPED_LIVE selinux-policy bug fix update 2016-05-10 22:33:46 UTC

Description Milos Malik 2015-11-06 10:52:13 UTC
Description of problem:
# sesearch -s virt_qemu_ga_t -t var_run_t -T
Found 2 semantic te rules:
   type_transition virt_qemu_ga_t var_run_t : file virt_qemu_ga_var_run_t; 
   type_transition virt_qemu_ga_t var_run_t : dir virt_qemu_ga_var_run_t; 

The qga.state file gets a correct label during its creation, but ...

# matchpathcon /var/run/qga.state 
/var/run/qga.state	system_u:object_r:var_run_t:s0

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
# service qemu-ga start
Starting qemu-ga:                                          [  OK  ]
# service qemu-ga status
qemu-ga (pid  5686) is running...
# service qemu-ga stop
Stopping qemu-ga:                                          [  OK  ]
# service qemu-ga status
qemu-ga is stopped
# ls -Z /var/run/qga.state 
-rw-------. root root unconfined_u:object_r:virt_qemu_ga_var_run_t:s0 /var/run/qga.state
# restorecon -v /var/run/qga.state 
restorecon reset /var/run/qga.state context unconfined_u:object_r:virt_qemu_ga_var_run_t:s0->unconfined_u:object_r:var_run_t:s0
# service qemu-ga start
Starting qemu-ga:                                          [  OK  ]
# service qemu-ga status
qemu-ga dead but subsys locked

Actual results:
type=PATH msg=audit(11/06/2015 11:44:26.525:898) : item=0 name=/var/run/qga.state inode=5387 dev=fc:03 mode=file,600 ouid=root ogid=root rdev=00:00 obj=unconfined_u:object_r:var_run_t:s0 nametype=NORMAL 
type=CWD msg=audit(11/06/2015 11:44:26.525:898) :  cwd=/ 
type=SYSCALL msg=audit(11/06/2015 11:44:26.525:898) : arch=x86_64 syscall=stat success=no exit=-13(Permission denied) a0=0x7f63439ef650 a1=0x7ffd26012af0 a2=0x7ffd26012af0 a3=0x22 items=1 ppid=1 pid=6184 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=1 comm=qemu-ga exe=/usr/bin/qemu-ga subj=unconfined_u:system_r:virt_qemu_ga_t:s0 key=(null) 
type=AVC msg=audit(11/06/2015 11:44:26.525:898) : avc:  denied  { getattr } for  pid=6184 comm=qemu-ga path=/var/run/qga.state dev=vda3 ino=5387 scontext=unconfined_u:system_r:virt_qemu_ga_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file 

Expected results:
 * no SELinux denials

Comment 1 Miroslav Grepl 2015-11-09 14:49:52 UTC
We need to add a default labeling.

Comment 6 errata-xmlrpc 2016-05-10 20:02:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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