Bug 974748

Summary: SELinux is preventing /usr/sbin/cupsd from 'write' accesses on the file subscriptions.conf.O.
Product: [Fedora] Fedora Reporter: Markus Haybach <markus>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, jpopelka, mgrepl, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:130ae95988abad73a7aa26a6ec2fbad281e7011bfb77379749184021a0f6ffc0
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 15:35:33 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 Markus Haybach 2013-06-15 11:01:11 UTC
Description of problem:
SELinux is preventing /usr/sbin/cupsd from 'write' accesses on the file subscriptions.conf.O.

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

If sie denken, dass es cupsd standardmässig erlaubt sein sollte, write Zugriff auf subscriptions.conf.O 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                unconfined_u:object_r:cupsd_etc_t:s0
Target Objects                subscriptions.conf.O [ file ]
Source                        cupsd
Source Path                   /usr/sbin/cupsd
Port                          <Unbekannt>
Host                          (removed)
Source RPM Packages           cups-1.6.2-4.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-44.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.2-301.fc19.x86_64 #1 SMP Mon
                              May 13 12:36:24 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-05-21 23:13:24 CEST
Last Seen                     2013-05-21 23:13:24 CEST
Local ID                      4759a97c-6992-4cfe-a690-8a50b62ab4a5

Raw Audit Messages
type=AVC msg=audit(1369170804.65:1009): avc:  denied  { write } for  pid=8896 comm="cupsd" name="subscriptions.conf.O" dev="sda5" ino=665183 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:cupsd_etc_t:s0 tclass=file


type=SYSCALL msg=audit(1369170804.65:1009): arch=x86_64 syscall=open success=no exit=EACCES a0=7fff8e97ad00 a1=81 a2=7fff8e97ad1e a3=1c items=0 ppid=1 pid=8896 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,cupsd_etc_t,file,write

Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.5-301.fc19.x86_64
type:           libreport

Potential duplicate: bug 809654

Comment 1 Daniel Walsh 2013-06-15 11:11:52 UTC
restorecon -R -v /etc/cups

Should fix this.

Comment 2 Daniel Walsh 2013-06-15 11:18:20 UTC
Tim is there any chance of moving cups rw config into a different directory?

I have no idea how this content could get mislabeled, since an admin process creating it or cupsd_t creating it would create it with the correct label.

Comment 3 Tim Waugh 2013-06-17 11:13:33 UTC
Do you think it would help if it were moved? I'm not sure I understand why.

Comment 4 Daniel Walsh 2013-06-18 15:43:02 UTC
Well it might help a little.  SELinux labels everything in a directory by default based on the directory label.  Since this directory contains both read/only content and read/write content, we label the directory with a read/only label.  This can lead to files that should be read/write being accidently labeled with the read/only label causing this AVC.

If we had separate directories for /etc/cups and /etc/cups/subscriptions/

Then we could label them differently and it would be less likely that an admin would end up with mislabeled content. 

That being said with newer file creation policy, we are seeing these kind of issues much less frequently.  I am not even sure how this file got mislabeled.  If i remove the file and touch it, it gets labeled correctly.

Comment 5 Fedora End Of Life 2015-01-09 18:26:31 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 6 Fedora End Of Life 2015-02-17 15:35:33 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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