Bug 437266 - File contexts for /usr/lib/cups/driver/*
File contexts for /usr/lib/cups/driver/*
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Josef Kubin
Fedora Extras Quality Assurance
:
: 437243 (view as bug list)
Depends On: 432375
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-13 06:09 EDT by Tim Waugh
Modified: 2008-06-16 23:03 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-16 23:03:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tim Waugh 2008-03-13 06:09:28 EDT
This fix is also needed for Fedora 7: see bug #437243.

+++ This bug was initially created as a clone of Bug #432375 +++

Description of problem:
/usr/lib/cups/driver and /usr/lib/cups/drivers/* need to have context
system_u:object_r:bin_t.

[root@cyberelk ~]# matchpathcon /usr/lib/cups/driver/drv
/usr/lib/cups/driver/drv        system_u:object_r:lib_t:s0
[root@cyberelk ~]# matchpathcon /usr/lib/cups/driver
/usr/lib/cups/driver    system_u:object_r:lib_t:s0

This works correctly for the filter and backend directories:

[root@cyberelk ~]# matchpathcon /usr/lib/cups/backend
/usr/lib/cups/backend   system_u:object_r:bin_t:s0
[root@cyberelk ~]# matchpathcon /usr/lib/cups/filter
/usr/lib/cups/filter    system_u:object_r:bin_t:s0

Version-Release number of selected component (if applicable):
selinux-policy-3.0.8-81.fc8

How reproducible:
100%

Steps to Reproduce:
1.Install cupsddk-drivers.
2.Run 'lpinfo -m'.
  
Actual results:
avc: denied { execute_no_trans } for comm=sh dev=md1 egid=7 euid=4 exe=/bin/bash
exit=-13 fsgid=7 fsuid=4 gid=7 items=0 path=/usr/lib/cups/driver/drv pid=27671
scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 sgid=7
subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 suid=4 tclass=file
tcontext=system_u:object_r:lib_t:s0 tty=(none) uid=4 

Expected results:
No AVC message.

-- Additional comment from dwalsh@redhat.com on 2008-02-11 14:28 EST --
Is there anything in this directory that is not bin_t?

Fixed in selinux-policy-3.0.8-84.fc8

-- Additional comment from twaugh@redhat.com on 2008-02-12 04:53 EST --
No.  Some entries may be symbolic links to files in /usr/bin -- which already
have appropriate file contexts.

-- Additional comment from dwalsh@redhat.com on 2008-02-12 10:14 EST --
Which would also be fine.  

But there is no files/sym_links going into this directory that you would not
want to allow execution?

-- Additional comment from twaugh@redhat.com on 2008-02-12 10:53 EST --
No, none.

I have tested selinux-policy-3.0.8-84.fc8 and it is not fixed.  I have found
that this is because I gave you the wrong path name in comment #0 (sorry!).

The correct path is: /usr/lib/cups/driver
("driver" not "drivers")

-/usr/lib(64)?/cups/drivers(/.*)?     gen_context(system_u:object_r:bin_t,s0)
+/usr/lib(64)?/cups/driver(/.*)?      gen_context(system_u:object_r:bin_t,s0)


-- Additional comment from dwalsh@redhat.com on 2008-02-12 13:07 EST --
Ok I am changing it to
/usr/lib(64)?/cups(/.*)?      gen_context(system_u:object_r:bin_t,s0)

Fixed in selinux-policy-3.0.8-85.fc8

-- Additional comment from twaugh@redhat.com on 2008-02-12 13:32 EST --
Oh, weren't we talking about the /usr/lib/cups/driver/ directory?  Anyway, your
more general change is correct and fixes some other problems I hadn't noticed
until just now (e.g. /usr/lib/cups/notifier/* binaries had the same problem as I
originally reported), but there are two exceptions:

/usr/lib/cups/backend/hp-* is hplip_exec_t
/usr/lib/cups/backend/cups-lpd is cupsd_lpd_exec_t

I think these are mentioned already in cups.fc so I think it should work
correctly(?).

-- Additional comment from dwalsh@redhat.com on 2008-02-12 13:43 EST --
Good catch, the fix should actually be in 85.

-- Additional comment from twaugh@redhat.com on 2008-02-25 10:41 EST --
Fix confirmed with 3.0.8-87.fc8.
Comment 1 Tim Waugh 2008-03-13 06:09:45 EDT
*** Bug 437243 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Walsh 2008-03-13 17:54:55 EDT
Josef,  You need

/usr/lib(64)?/cups(/.*)?		gen_context(system_u:object_r:bin_t,s0)

in corecmds.fc
Comment 3 Josef Kubin 2008-03-16 23:10:48 EDT
Fixed in selinux-policy-2.6.4-73.fc7.
Comment 4 Bug Zapper 2008-05-14 11:22:41 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Bug Zapper 2008-06-16 23:03:33 EDT
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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