Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1598392 - virtlogd entered failed state with "Permission denied" error after reload
Summary: virtlogd entered failed state with "Permission denied" error after reload
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-05 10:02 UTC by yanqzhan@redhat.com
Modified: 2018-10-30 10:06 UTC (History)
13 users (show)

Fixed In Version: selinux-policy-3.13.1-217.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:06:08 UTC
Target Upstream Version:


Attachments (Terms of Use)
audit_n_syslog (deleted)
2018-07-05 10:09 UTC, yanqzhan@redhat.com
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1444547 None None None Never
Red Hat Product Errata RHBA-2018:3111 None None None 2018-10-30 10:06:40 UTC

Internal Links: 1444547

Description yanqzhan@redhat.com 2018-07-05 10:02:28 UTC
Description of problem:
virtlogd.service entered failed state with "Permission denied" error after reload

Version-Release number of selected component (if applicable):
libvirt-4.5.0-1.el7.x86_64
qemu-kvm-rhev-2.12.0-7.el7.x86_64
selinux-policy-3.13.1-207.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.Check virtlogd.service is running
# systemctl status virtlogd -l
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: active (running) since Thu 2018-07-05 05:45:26 EDT; 11s ago
     Docs: man:virtlogd(8)
           https://libvirt.org
 Main PID: 11946 (virtlogd)
    Tasks: 1
   CGroup: /system.slice/virtlogd.service
           └─11946 /usr/sbin/virtlogd

2.# systemctl reload virtlogd

3.# systemctl status virtlogd -l
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2018-07-05 05:46:01 EDT; 1s ago
     Docs: man:virtlogd(8)
           https://libvirt.org
  Process: 11990 ExecReload=/bin/kill -USR1 $MAINPID (code=exited, status=0/SUCCESS)
  Process: 11946 ExecStart=/usr/sbin/virtlogd $VIRTLOGD_ARGS (code=exited, status=9)
 Main PID: 11946 (code=exited, status=9)

Jul 05 05:45:26 hp-***.redhat.com systemd[1]: Started Virtual machine log manager.
Jul 05 05:46:01 hp-***.redhat.com systemd[1]: Reloading Virtual machine log manager.
Jul 05 05:46:01 hp-***redhat.com systemd[1]: Reloaded Virtual machine log manager.
Jul 05 05:46:01 hp-***.redhat.com virtlogd[11946]: 2018-07-05 09:46:01.383+0000: 11946: info : libvirt version: 4.5.0, package: 1.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2018-07-03-10:54:58, x86-039.build.eng.bos.redhat.com)
Jul 05 05:46:01 hp-***.redhat.com virtlogd[11946]: 2018-07-05 09:46:01.383+0000: 11946: info : hostname: hp-***.redhat.com
Jul 05 05:46:01 hp-***.redhat.com virtlogd[11946]: 2018-07-05 09:46:01.383+0000: 11946: error : virLogDaemonPreExecRestart:865 : Unable to restart self: Permission denied
Jul 05 05:46:01 hp-***redhat.com systemd[1]: virtlogd.service: main process exited, code=exited, status=9/n/a
Jul 05 05:46:01 hp-***.redhat.com systemd[1]: Unit virtlogd.service entered failed state.
Jul 05 05:46:01 hp-***.redhat.com systemd[1]: virtlogd.service failed.

4.start the virtlogd.service and check the status again:
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: active (running) since Thu 2018-07-05 05:50:34 EDT; 2s ago
     Docs: man:virtlogd(8)
           https://libvirt.org
  Process: 11990 ExecReload=/bin/kill -USR1 $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 12161 (virtlogd)
    Tasks: 1
   CGroup: /system.slice/virtlogd.service
           └─12161 /usr/sbin/virtlogd
...
Jul 05 05:50:34 hp-***.redhat.com virtlogd[12161]: 2018-07-05 09:50:34.239+0000: 12161: warning : virLogDaemonPostExecRestart:782 : Found restart exec file with old magic 11946 vs wanted 12161
...


Actual results:
As in step 3, virtlogd.service entered failed state with "Permission denied" error after reload. And in step4, still a warning after start the service.

Expected results:
virtlogd.service should be reloaded successfully without error.

Additional info:

Comment 2 yanqzhan@redhat.com 2018-07-05 10:09:02 UTC
Created attachment 1456746 [details]
audit_n_syslog

Comment 4 Erik Skultety 2018-08-17 08:53:17 UTC
Are you sure nothing is missing in the reproducer? I've got an almost identical environment (slightly more recent qemu build), but I'm not able to reproduce this issue, I've got a VM running, virtlogd running and it reloads without any issues.

Comment 7 Erik Skultety 2018-08-21 13:33:22 UTC
So I tried on my 7.5 machine with selinux-policy-3.13.1-192 and I can't reproduce with upstream. At the same time, with selinux-policy-3.13.1-207 onwards, I'm hitting permission denied on virtlogd reload on older releases of libvirt too. Therefore, moving this to selinux-policy component.

Comment 8 Milos Malik 2018-08-21 13:54:12 UTC
----
type=PROCTITLE msg=audit(08/21/2018 09:52:49.781:3241) : proctitle=/usr/sbin/virtlogd 
type=PATH msg=audit(08/21/2018 09:52:49.781:3241) : item=0 name=/usr/sbin/virtlogd inode=1135232 dev=fd:00 mode=file,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:virtlogd_exec_t:s0 objtype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(08/21/2018 09:52:49.781:3241) :  cwd=/ 
type=SYSCALL msg=audit(08/21/2018 09:52:49.781:3241) : arch=x86_64 syscall=execve success=no exit=EACCES(Permission denied) a0=0x7fff1a9faf6b a1=0x7fff1a9f9538 a2=0x7fff1a9f9548 a3=0x7fff1a9f8820 items=1 ppid=1 pid=424246 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=virtlogd exe=/usr/sbin/virtlogd subj=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 key=(null) 
type=AVC msg=audit(08/21/2018 09:52:49.781:3241) : avc:  denied  { execute_no_trans } for  pid=424246 comm=virtlogd path=/usr/sbin/virtlogd dev="dm-0" ino=1135232 scontext=system_u:system_r:virtlogd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:virtlogd_exec_t:s0 tclass=file permissive=0 
----

Comment 12 errata-xmlrpc 2018-10-30 10:06:08 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.

https://access.redhat.com/errata/RHBA-2018:3111


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