Bug 1278747 - SELinux file context pattern for /var/run/qga.state is incorrect
SELinux file context pattern for /var/run/qga.state is incorrect
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.7
All Linux
medium Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-06 05:52 EST by Milos Malik
Modified: 2016-09-02 09:16 EDT (History)
7 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-282.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-10 16:02:23 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 Milos Malik 2015-11-06 05:52:13 EST
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):
qemu-guest-agent-0.12.1.2-2.479.el6.x86_64
selinux-policy-3.7.19-281.el6.noarch
selinux-policy-doc-3.7.19-281.el6.noarch
selinux-policy-minimum-3.7.19-281.el6.noarch
selinux-policy-mls-3.7.19-281.el6.noarch
selinux-policy-targeted-3.7.19-281.el6.noarch

How reproducible:
always

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 09:49:52 EST
We need to add a default labeling.
Comment 6 errata-xmlrpc 2016-05-10 16:02:23 EDT
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.

https://rhn.redhat.com/errata/RHBA-2016-0763.html

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