Bug 917756

Summary: SELinux is preventing /usr/sbin/cupsd from 'getattr' accesses on the fifo_file /var/spool/cups/tmp/hpfax-pipe-1.
Product: [Fedora] Fedora Reporter: chrys87
Component: hplipAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, jpopelka, mgrepl, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:e2f88bc9787ed9ce6e4967c417ef6ce75ff10dc31aff1652849a9959ee0f7cb4
Fixed In Version: hplip-3.13.3-2.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 918086 (view as bug list) Environment:
Last Closed: 2013-04-10 01:29:24 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:
Bug Depends On:    
Bug Blocks: 918086    

Description chrys87 2013-03-04 17:39:10 UTC
Description of problem:
SELinux is preventing /usr/sbin/cupsd from 'getattr' accesses on the fifo_file /var/spool/cups/tmp/hpfax-pipe-1.

*****  Plugin catchall (100. confidence) suggests  ***************************

If sie denken, dass es cupsd standardmässig erlaubt sein sollte, getattr Zugriff auf hpfax-pipe-1 fifo_file zu erhalten.
Then sie sollten dies als Fehler melden.
Um diesen Zugriff zu erlauben, können Sie ein lokales Richtlinien-Modul erstellen.
Do
zugriff jetzt erlauben, indem Sie die nachfolgenden Befehle ausführen:
# grep cupsd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:cupsd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:print_spool_t:s0
Target Objects                /var/spool/cups/tmp/hpfax-pipe-1 [ fifo_file ]
Source                        cupsd
Source Path                   /usr/sbin/cupsd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           cups-1.5.4-20.fc18.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-81.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.9-205.fc18.i686.PAE #1 SMP Sun
                              Feb 24 20:58:16 UTC 2013 i686 i686
Alert Count                   2
First Seen                    2013-03-01 10:52:31 CET
Last Seen                     2013-03-04 16:49:25 CET
Local ID                      75adbcce-0177-4269-b1a4-9c86dbd5dfb7

Raw Audit Messages
type=AVC msg=audit(1362412165.20:334): avc:  denied  { getattr } for  pid=1664 comm="cupsd" path="/var/spool/cups/tmp/hpfax-pipe-1" dev="sda1" ino=1585238 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:print_spool_t:s0 tclass=fifo_file


type=SYSCALL msg=audit(1362412165.20:334): arch=i386 syscall=stat64 success=no exit=EACCES a0=bfd12128 a1=b8e571a8 a2=b724b000 a3=b8e56ca0 items=0 ppid=1 pid=1664 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=cupsd exe=/usr/sbin/cupsd subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null)

Hash: cupsd,cupsd_t,print_spool_t,fifo_file,getattr

audit2allow

#============= cupsd_t ==============
allow cupsd_t print_spool_t:fifo_file getattr;

audit2allow -R

#============= cupsd_t ==============
allow cupsd_t print_spool_t:fifo_file getattr;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.9-205.fc18.i686.PAE
type:           libreport

Comment 1 Daniel Walsh 2013-03-04 18:22:16 UTC
Is there a reason this is here rather then under /run?

Comment 2 Tim Waugh 2013-03-05 09:33:57 UTC
It does look like that's in the wrong place.  Upstream HPLIP puts it in /tmp, but it just needs to be anywhere that can be accessed by a user logged in at the console. (A D-Bus message is sent to an activatable user process.)

If I change the location to /run/hplip/, we'll need to make sure that directory gets the correct file context -- which would be cupsd_var_run_t I guess?

Comment 3 Miroslav Grepl 2013-03-05 09:56:27 UTC
Yes.

Comment 4 Tim Waugh 2013-03-05 11:25:21 UTC
OK. Let me know when a new selinux-policy package has been built with an updated path context for /run/hplip.

Here's the specfile change for hplip.spec:

+%dir %attr(0775,root,lp) %{_localstatedir}/run/hplip

Comment 5 Fedora Update System 2013-03-15 12:04:23 UTC
hplip-3.13.3-2.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/hplip-3.13.3-2.fc18

Comment 6 Fedora Update System 2013-03-16 01:23:37 UTC
Package hplip-3.13.3-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing hplip-3.13.3-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3901/hplip-3.13.3-2.fc18
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2013-04-10 01:29:26 UTC
hplip-3.13.3-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.