RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1142454 - sanlock not allowed to send SIGTERM or SIGKILL signals
Summary: sanlock not allowed to send SIGTERM or SIGKILL signals
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.0
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 1141658 1151835 1152594 1172147
TreeView+ depends on / blocked
 
Reported: 2014-09-16 19:35 UTC by David Teigland
Modified: 2023-09-14 02:47 UTC (History)
11 users (show)

Fixed In Version: selinux-policy-3.13.1-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1152594 1172147 (view as bug list)
Environment:
Last Closed: 2015-03-05 10:40:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
audit.log (4.43 MB, text/plain)
2014-09-16 19:35 UTC, David Teigland
no flags Details
audit log from another machine (31.50 KB, text/plain)
2014-09-16 21:11 UTC, Nir Soffer
no flags Details
audit log from fedora 19 (4.46 MB, text/plain)
2014-09-17 22:45 UTC, Nir Soffer
no flags Details
audit log from fedora 19 (127.04 KB, application/octet-stream)
2014-09-17 22:47 UTC, Nir Soffer
no flags Details
audit log from fedora 20 (66.71 KB, application/octet-stream)
2014-09-17 22:48 UTC, Nir Soffer
no flags Details
Output of ps -efZ on all ovirt/rhev supported platforms (6.39 KB, text/plain)
2014-10-05 21:43 UTC, Nir Soffer
no flags Details
Output of ps -efZ on all ovirt/rhev supported platforms (6.39 KB, text/plain)
2014-10-05 21:47 UTC, Nir Soffer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0458 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2015-03-05 15:17:00 UTC

Description David Teigland 2014-09-16 19:35:55 UTC
Created attachment 938211 [details]
audit.log

Description of problem:

While investigating bug 1141658, we discovered a lot of complaining about sanlock in audit.log.  The problem in that bug is that SIGTERM sent from sanlock to vdsm is not being seen by vdsm.

Full audit.log attached, but a sample:

type=AVC msg=audit(1410877425.387:3337): avc:  denied  { read } for  pid=1504 comm="sanlock" name="253:18" dev="sysfs" ino=19700 scontext=system_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysfs_t:s0 tclass=lnk_file
type=SYSCALL msg=audit(1410877425.387:3337): arch=c000003e syscall=2 success=no exit=-13 a0=7f3a9c814940 a1=80000 a2=16 a3=0 items=0 ppid=1 pid=1504 auid=4294967295 uid=179 gid=179 euid=179 suid=179 fsuid=179 egid=179 sgid=179 fsgid=179 tty=(none) ses=4294967295 comm="sanlock" exe="/usr/sbin/sanlock" subj=system_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Nir Soffer 2014-09-16 21:11:00 UTC
Created attachment 938243 [details]
audit log from another machine

From the log it looks like sanlock-helper is not allowed to send SIGTERM and SIGKILL to vdsm.

The number of the attempts match sanlock logic and what I could see in sanlock.log while reproducing this issue.

Comment 3 Nir Soffer 2014-09-17 22:40:00 UTC
I reproduce the same issue on Fedora 19.

1. 40 retries to send SIGTERM:

type=AVC msg=audit(1410992928.276:1447): avc:  denied  { signal } for  pid=3878 comm="sanlock-helper" scontext=system_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:system_r:initrc_t:s0 tclass=process
type=SYSCALL msg=audit(1410992928.276:1447): arch=c000003e syscall=62 success=no exit=-13 a0=f7e a1=f a2=200 a3=4 items=0 ppid=3877 pid=3878 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sanlock-helper" exe="/usr/sbin/sanlock" subj=system_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)

2. Couple of retries to send SIGKILL

type=AVC msg=audit(1410992976.124:1495): avc:  denied  { sigkill } for  pid=3878 comm="sanlock-helper" scontext=system_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:system_r:initrc_t:s0 tclass=process
type=SYSCALL msg=audit(1410992976.124:1495): arch=c000003e syscall=62 success=no exit=-13 a0=f7e a1=9 a2=200 a3=4 items=0 ppid=3877 pid=3878 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sanlock-helper" exe="/usr/sbin/sanlock" subj=system_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)

On Fedora 20, we the behavior is little better:

1. 40 retries to send SIGTERM

type=AVC msg=audit(1410991380.283:100996): avc:  denied  { signal } for  pid=678 comm="sanlock-helper" scontext=system_u:system_r:sanlock_t:s0-s0:c0.c1023 tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023 tclass=process permissive=0
type=SYSCALL msg=audit(1410991380.283:100996): arch=c000003e syscall=62 success=no exit=-13 a0=79a a1=f a2=200 a3=6 items=0 ppid=677 pid=678 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sanlock-helper" exe="/usr/sbin/sanlock" subj=system_u:system_r:sanlock_t:s0-s0:c0.c1023 key=(null)

2. The first attempt to send SIGKILL succeeds, and the host
   is not rebooted.

Comment 4 Nir Soffer 2014-09-17 22:45:30 UTC
Created attachment 938662 [details]
audit log from fedora 19

Comment 5 Nir Soffer 2014-09-17 22:47:43 UTC
Created attachment 938663 [details]
audit log from fedora 19

Comment 6 Nir Soffer 2014-09-17 22:48:17 UTC
Created attachment 938670 [details]
audit log from fedora 20

Comment 8 Miroslav Grepl 2014-09-29 12:46:27 UTC
What does

# ps -efZ |grep initrc_t

Comment 9 David Teigland 2014-09-29 21:10:13 UTC
I suspect that would need that to be run on a RHEV host.  Nir?

Comment 10 Nir Soffer 2014-10-05 21:43:07 UTC
Created attachment 944107 [details]
Output of ps -efZ on all ovirt/rhev supported platforms

Comment 11 Nir Soffer 2014-10-05 21:44:07 UTC
(In reply to Miroslav Grepl from comment #8)
> What does
> # ps -efZ |grep initrc_t
See attachment 944107 [details]

Comment 12 Nir Soffer 2014-10-05 21:47:08 UTC
Created attachment 944108 [details]
Output of ps -efZ on all ovirt/rhev supported platforms

This version fix wrong rhel6.5 data that sneaked into the rehl7 data.

Comment 13 Miroslav Grepl 2014-10-10 08:57:18 UTC
# rpm -q selinux-policy

I believe we have fixes in the latest policy builds.

Comment 15 Miroslav Grepl 2014-10-10 09:44:37 UTC
commit 2c027d0b63c43d328a75ea7cdb5d711f45b1280d
Author: Miroslav Grepl <mgrepl>
Date:   Fri Oct 10 11:43:42 2014 +0200

    ALlow sanlock to send a signal to virtd_t.

Comment 16 Nir Soffer 2014-10-12 14:03:59 UTC
(In reply to Miroslav Grepl from comment #15)
> commit 2c027d0b63c43d328a75ea7cdb5d711f45b1280d
> Author: Miroslav Grepl <mgrepl>
> Date:   Fri Oct 10 11:43:42 2014 +0200
> 
>     ALlow sanlock to send a signal to virtd_t.

Miroslav, according to attachment 944107 [details] vdsm does not run as 
virtd_t on rhel7.

RHEL 6.5:
# ps -efZ | grep vdsm
system_u:system_r:virtd_t:s0-s0:c0.c1023 vdsm 3007 3005  4 Oct05 ?     00:05:02 /usr/bin/python /usr/share/vdsm/vdsm --pidfile /var/run/vdsm/vdsmd.pid

RHEL 7:
# ps -efZ | grep vdsm
system_u:system_r:init_t:s0     vdsm      7790     1  4 Oct05 ?        00:03:25 /usr/bin/python /usr/share/vdsm/vdsm

Fedora 19:
# ps -efZ | grep vdsm
system_u:system_r:initrc_t:s0   vdsm      1732     1  3 Sep30 ?        04:48:56 /usr/bin/python /usr/share/vdsm/vdsm

Fedora 20:
# ps -efZ | grep vdsm
system_u:system_r:virtd_t:s0-s0:c0.c1023 vdsm 1851 1  3 00:31 ?        00:00:17 /usr/bin/python /usr/share/vdsm/vdsm

So it seems that the issue is not only sanlock issue but also
different selinux policy for vdsm on different platforms.

Do you know why vdsm is running as "virtd_t", "init_t", and "initrc_t"?
Shouldn't it be the same label under all platforms?

Comment 17 Nir Soffer 2014-10-12 14:06:42 UTC
Correction: I meant attachment 944108 [details] (replaced attachment 944107 [details]).

Comment 18 Milos Malik 2014-10-13 07:43:35 UTC
(In reply to Nir Soffer from comment #16)
> 
> Do you know why vdsm is running as "virtd_t", "init_t", and "initrc_t"?
> Shouldn't it be the same label under all platforms?

The vdsm and supervdsmServer processes in RHEL-6.6 are already confined:
 * see BZ#1064270 - vdsm and supervdsmServer run as initrc_t.

The vdsm and supervdsmServer processes in RHEL-7.1 will be confined soon:
 * see BZ#1064277 - vdsm and supervdsmServer run as init_t.

I'm not sure if the new policies for vdsm and supervdsmServer will be ported to Fedora 19 and Fedora 20.

AFAIK all processes that are not confined run as initrc_t on RHEL-6 because they were started by a process running as initrc_t (upstart). All processes that are not confined run as init_t on RHEL-7 because they were started by a process running as init_t (systemd).

Comment 19 Miroslav Grepl 2014-10-13 07:52:40 UTC
We have unconfined_services_t pro rawhide/F21/RHEL7.1. 

Also vdsm and supervdsmServer processes in RHEL-7.1 are already confined. PLease just use the latest RHEL7.1 builds.

Nir,
any chance to re-test it?

Comment 20 Nir Soffer 2014-10-13 08:07:55 UTC
(In reply to Miroslav Grepl from comment #19)
> We have unconfined_services_t pro rawhide/F21/RHEL7.1.

I don't follow - can you explain?
 
> Also vdsm and supervdsmServer processes in RHEL-7.1 are already confined.
> PLease just use the latest RHEL7.1 builds.
> any chance to re-test it?

Can you point us to the build that works with this RHEL 7.0.z?

Comment 21 Nir Soffer 2014-10-13 13:06:05 UTC
What would be the best way to ensure that we get this fix also on Fedora? Should we clone this bug to Fedora?

Comment 22 Miroslav Grepl 2014-10-13 14:30:24 UTC
I added all fixes to Fedora.

Comment 29 errata-xmlrpc 2015-03-05 10:40:52 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://rhn.redhat.com/errata/RHBA-2015-0458.html

Comment 30 Red Hat Bugzilla 2023-09-14 02:47:40 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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