Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 760462

Summary: xguest_u is allowed to run "getsebool -a" but guest_u is not
Product: Red Hat Enterprise Linux 6 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: dwalsh
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-08 11:32:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Milos Malik 2011-12-06 09:12:03 UTC
Description of problem:


Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-124.el6.noarch
selinux-policy-targeted-3.7.19-124.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. create a xguest_u user
2. log in as this user
3. run "getsebool -a"
4. create a guest_u user
5. log in as this user
6. run "getsebool -a"

Actual results:
* "getsebool -a" executed by xguest_u user prints all booleans
* "getsebool -a" executed by guest_u user prints following message:
getsebool:  Unable to get boolean names:  Permission denied

Expected results:
* the output of "getsebool -a" should be the same in both cases

Comment 1 Milos Malik 2011-12-06 09:20:39 UTC
Following AVC appears when dontaudit rules are turned off:
----
time->Tue Dec  6 03:52:34 2011
type=SYSCALL msg=audit(1323161554.372:485625): arch=c000003e syscall=2 success=no exit=-13 a0=7fffb5e0e210 a1=90800 a2=3199008260 a3=fffffff6 items=0 ppid=12741 pid=12768 auid=504 uid=504 gid=505 euid=504 suid=504 fsuid=504 egid=505 sgid=505 fsgid=505 tty=pts0 ses=25366 comm="getsebool" exe="/usr/sbin/getsebool" subj=guest_u:guest_r:guest_t:s0 key=(null)
type=AVC msg=audit(1323161554.372:485625): avc:  denied  { read } for  pid=12768 comm="getsebool" name="booleans" dev=selinuxfs ino=21 scontext=guest_u:guest_r:guest_t:s0 tcontext=system_u:object_r:security_t:s0 tclass=dir
----

Comment 2 Daniel Walsh 2011-12-07 15:22:16 UTC
The reason for this is that restorecond is running for the xguest user to make sure content in his homedir is labeled correctly.  I believe it needs to read security_t content in order for it to get the labels right.  guest_t does not run restorecond so it does  not need this access.

Comment 3 Miroslav Grepl 2011-12-07 15:49:28 UTC
Yes, this is correct. We have in the policy

    seutil_exec_restorecond($1_t)
    seutil_read_file_contexts($1_t)
    seutil_read_default_contexts($1_t)