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 1167201 - virt-who runs as unconfined_service_t
Summary: virt-who runs as unconfined_service_t
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: John Sefler
URL:
Whiteboard:
Depends On: 1166537
Blocks: 1061797
TreeView+ depends on / blocked
 
Reported: 2014-11-24 08:13 UTC by Miroslav Grepl
Modified: 2016-12-01 00:33 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1166537
Environment:
Last Closed: 2014-11-24 09:26:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Miroslav Grepl 2014-11-24 08:13:24 UTC
+++ This bug was initially created as a clone of Bug #1166537 +++

Description of problem:

# rpm -ql virt-who |grep -e systemd -e bin | xargs ls -Z
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/virt-who
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/bin/virt-who-password
-rw-r--r--. root root system_u:object_r:virtd_unit_file_t:s0 /usr/lib/systemd/system/virt-who.service
#
# systemctl start virt-who
# systemctl status virt-who
virt-who.service - Daemon for reporting virtual guest IDs to subscription-manager
   Loaded: loaded (/usr/lib/systemd/system/virt-who.service; disabled)
   Active: active (running) since Fri 2014-11-21 09:07:18 CET; 3s ago
 Main PID: 16134 (python)
   CGroup: /system.slice/virt-who.service
           └─16134 /usr/bin/python /usr/share/virt-who/virtwho.py
#
# ps -efZ |grep virt-who
system_u:system_r:unconfined_service_t:s0 root 16134 1  4 09:07 ?      00:00:01 /usr/bin/python /usr/share/virt-who/virtwho.py


Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-9.el7.noarch

How reproducible:
always

--- Additional comment from Miroslav Grepl on 2014-11-21 04:32:20 EST ---

Could you label them as virtd_exec_t? It should work.

# chcon -t virtd_exec_t /usr/share/virt-who/virtwho.py

--- Additional comment from Patrik Kis on 2014-11-21 05:53:23 EST ---

(In reply to Miroslav Grepl from comment #1)
> Could you label them as virtd_exec_t? It should work.
> 
> # chcon -t virtd_exec_t /usr/share/virt-who/virtwho.py

Does not really help:

# ls -Z /usr/share/virt-who/virtwho.py
-rw-r--r--. root root system_u:object_r:usr_t:s0       /usr/share/virt-who/virtwho.py
# ps -efZ |grep -v grep |grep virt-who
system_u:system_r:unconfined_service_t:s0 root 155680 1  0 05:49 ?       00:00:00 /usr/bin/python /usr/share/virt-who/virtwho.py
#
#
# chcon -t virtd_exec_t /usr/share/virt-who/virtwho.py
# ls -Z /usr/share/virt-who/virtwho.py
-rw-r--r--. root root system_u:object_r:virtd_exec_t:s0 /usr/share/virt-who/virtwho.py
# systemctl restart virt-who
# ps -efZ |grep -v grep |grep virt-who
system_u:system_r:unconfined_service_t:s0 root 155799 1 24 05:52 ?       00:00:00 /usr/bin/python /usr/share/virt-who/virtwho.py

--- Additional comment from Miroslav Grepl on 2014-11-24 03:07:18 EST ---

Yes, because of

/usr/bin/python /usr/share/virt-who/virtwho.py

They will need to add a helper script which will run it. Then we can label this helper script to make it working.

Comment 1 Radek Novacek 2014-11-24 08:35:38 UTC
There is a `/usr/bin/virt-who` script that runs:

exec /usr/bin/python /usr/share/virt-who/virtwho.py "$@"

Would it suffice to label this script as `virtd_exec_t`? Will it affect commandline usage of the program? This script is also started from the virt-who.service unit.

Comment 3 Miroslav Grepl 2014-11-24 09:26:31 UTC
Yes, I overlooked it. Thank you.

I see it

ExecStart=/usr/bin/virt-who


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