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 741271 - selinux-policy spice-vdagent rules need update because of new agent features
Summary: selinux-policy spice-vdagent rules need update because of new agent features
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: 6.2
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks: 740851 747120
TreeView+ depends on / blocked
 
Reported: 2011-09-26 13:16 UTC by Hans de Goede
Modified: 2016-08-12 17:04 UTC (History)
2 users (show)

Fixed In Version: selinux-policy-3.7.19-115.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:19:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
avc-s selinux is denying which should be allowed (947 bytes, text/plain)
2011-09-26 13:16 UTC, Hans de Goede
no flags Details
avc-s selinux is denying which should not be logged (silenced) (716 bytes, text/plain)
2011-09-26 13:17 UTC, Hans de Goede
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1511 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2011-12-06 00:39:17 UTC

Description Hans de Goede 2011-09-26 13:16:37 UTC
Created attachment 524902 [details]
avc-s selinux is denying which should be allowed

Hi,

Sorry about this, esp. after you just having fixed bug 737790, well at least
I'm learning and filing bugs before QA hits them now.

spice-vdagent has grown the capability to generate xorg.conf files, this may seem weird, but it is needed for multi monitor linux guests, since this uses Xinerama and that needs an xorg.conf, for more details see bug 740851.

This capability requires the vdagentd process to read some files under sysfs
(to get some pci device info through libpciaccess), which selinux currently is denying it.

I've run some tests with enforcing on / off. I'm going to attach 2 files, one named denied, this files contains things which selinux is denying which are breaking the new functionality. After running this through audit2allow everything works fine with selinux in enforcing mode.

The second file is called silence, this contains some denies which selinux is denying which are ok to deny, but it would be nice if the avc logging for these denies could be silenced.

Note I tested this with an F-16 guest, I'll go and update my RHEL-6 guest to the latest 6.2 bits and reproduce it there, but I don't expect any different results.

Thanks,

Hans

Comment 1 Hans de Goede 2011-09-26 13:17:35 UTC
Created attachment 524903 [details]
avc-s selinux is denying which should not be logged (silenced)

Comment 2 Miroslav Grepl 2011-09-26 14:10:53 UTC
Ok, any idea why sys_admin capability is needed?

CAP_SYS_ADMIN
              * Perform a range of system administration operations
                including:   quotactl(2),   mount(2),    umount(2),
                swapon(2),  swapoff(2),  sethostname(2), and setdo‐
                mainname(2);
              * perform IPC_SET and IPC_RMID  operations  on  arbi‐
                trary System V IPC objects;
              * perform operations on trusted and security Extended
                Attributes (see attr(5));
              * use lookup_dcookie(2);
              * use ioprio_set(2)  to  assign  IOPRIO_CLASS_RT  and
                (before  Linux 2.6.25) IOPRIO_CLASS_IDLE I/O sched‐
                uling classes;
              * forge UID when passing socket credentials;
              * exceed /proc/sys/fs/file-max, the system-wide limit
                on  the  number of open files, in system calls that
                open files (e.g.,  accept(2),  execve(2),  open(2),
                pipe(2));
              * employ   CLONE_NEWNS   flag   with   clone(2)   and
                unshare(2);
              * perform KEYCTL_CHOWN and  KEYCTL_SETPERM  keyctl(2)
                operations;
              * perform madvise(2) MADV_HWPOISON operation.

Comment 3 Hans de Goede 2011-09-26 14:28:01 UTC
(In reply to comment #2)
> Ok, any idea why sys_admin capability is needed?

No clue, I'm pretty sure this is coming from libpciaccess. Note that it is not
*needed* it is trying to do something which needs it but if that fails it goes on happily. I only ran the denied attachment through audit2allow (and loaded the resulting module) and that was enough. I deliberately did not run the other avc's through audit2allow as I didn't see how / why libpciaccess needs them for just enumerating, and indeed things work fine in enforcing mode with those being denied.

I guess it may have something to do with libpciaccess being meant to actually do pci device access (think iopl for example), while I'm only using it for enumeration.

Comment 4 Daniel Walsh 2011-09-26 16:02:33 UTC
Ok lets dontaudit and see if anyone complains.

Comment 5 Miroslav Grepl 2011-10-03 14:01:05 UTC
Fixed in selinux-policy-3.7.19-114.el6

Comment 7 Miroslav Grepl 2011-10-04 11:02:25 UTC
I am fixing the interface.

Comment 8 Miroslav Grepl 2011-10-05 13:39:44 UTC
Fixed in selinux-policy-3.7.19-115.el6

Comment 11 errata-xmlrpc 2011-12-06 10:19:29 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.

http://rhn.redhat.com/errata/RHBA-2011-1511.html


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