Bug 597589

Summary: SELinux is preventing /usr/lib/cups/backend/mfp "read" access on libmfp.so.1.0.1.
Product: [Fedora] Fedora Reporter: Viktor Erdelyi <verdelyi>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:799810524dabfc65a574032e3995bf6669613f4045fe4efc3507ab22c5fc0d5e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-05-31 13:30:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Viktor Erdelyi 2010-05-29 17:48:10 UTC

SELinux is preventing /usr/lib/cups/backend/mfp "read" access on

Detailed Description:

SELinux denied access requested by mfp. It is not expected that this access is
required by mfp and this access may signal an intrusion attempt. It is also
possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

You can generate a local policy module to allow this access - see FAQ
(http://docs.fedoraproject.org/selinux-faq-fc5/#id2961385) Please file a bug

Additional Information:

Source Context                unconfined_u:system_r:cupsd_t:s0-s0:c0.c1023
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                libmfp.so.1.0.1 [ file ]
Source                        mfp
Source Path                   /usr/lib/cups/backend/mfp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-21.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   catchall
Host Name                     (removed)
Platform                      Linux sierravista.nyetwork
                              #1 SMP Thu May 13 05:55:24 UTC 2010 i686 i686
Alert Count                   2
First Seen                    Sat 29 May 2010 07:40:28 PM CEST
Last Seen                     Sat 29 May 2010 07:40:28 PM CEST
Local ID                      4e9fd16e-c646-454d-bedb-a4afdd423d61
Line Numbers                  

Raw Audit Messages            

node=sierravista.nyetwork type=AVC msg=audit(1275154828.836:140): avc:  denied  { read } for  pid=14776 comm="mfp" name="libmfp.so.1.0.1" dev=dm-1 ino=10125 scontext=unconfined_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file

node=sierravista.nyetwork type=SYSCALL msg=audit(1275154828.836:140): arch=40000003 syscall=5 success=no exit=-13 a0=bf883c00 a1=0 a2=0 a3=8 items=0 ppid=14770 pid=14776 auid=500 uid=4 gid=7 euid=4 suid=4 fsuid=4 egid=7 sgid=7 fsgid=7 tty=(none) ses=1 comm="mfp" exe="/usr/lib/cups/backend/mfp" subj=unconfined_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null)

Hash String generated from  catchall,mfp,cupsd_t,user_home_t,file,read
audit2allow suggests:

#============= cupsd_t ==============
allow cupsd_t user_home_t:file read;

Comment 1 Viktor Erdelyi 2010-05-29 17:57:57 UTC
I got this when installing the Samsung SCX-4200 printer driver. It installs lots of files and I get AVCs for almost all of them. Some of them give me a "fix command" with some restorecon line but some of them just point me to the FAQ (where additionally, the table of contents links seem not to work in any browser: http://docs.fedoraproject.org/en-US/Fedora/13/html/SELinux_FAQ/index.html).

(But I don't think it should use MFP at all, the printer connection says USB.)

Comment 2 Viktor Erdelyi 2010-05-29 18:03:22 UTC
Possible filelist from the driver installer directory:
(all of them go below /usr)


Comment 3 Viktor Erdelyi 2010-05-29 18:22:23 UTC
Running restorecon on ALL of these helped a little but I'm still concerned about the driver installation process. We need a way to automatically set the proper (:=what restorecon restores) context when installing a file anywhere (like umask sets the permissions on file creation).

Now, when I start the driver installation, I
* either have to put selinux in permissive mode
* or I get lots of AVC denials which can have a negative effect on the installation procedure, for example if the installer detects that an operation has failed, it aborts or messes up something. OK, I know that the installer itself should try to set the context but 3rd party drivers won't.

Comment 4 Viktor Erdelyi 2010-05-29 18:37:26 UTC
And what about /opt/Samsung/mfp/share/ppd/*? I also get AVCs for them (one for each ppd file, ~50) and restorecon did not help.

Comment 5 Miroslav Grepl 2010-05-31 13:30:39 UTC
> #============= cupsd_t ==============
> allow cupsd_t user_home_t:file read;    

You can allow it and other issues using 

# grep cupsd /var/log/audit/audit.log | audit2allow -M mycups
# semodule -i mycups.pp  

> And what about /opt/Samsung/mfp/share/ppd/*? I also get AVCs for them (one for > each ppd file, ~50) and restorecon did not help. 

Try to setup cupsd_rw_etc_t context for '/opt/Samsung/mfp/share/ppd/' directory.

# chcon -R -t cupsd_rw_etc_t /opt/Samsung/mfp/share/ppd/

Generally this is a problem with third-party application. We can and we often define contexts for directories/files, which are installed by third-party apps. If provider of third-party apps includes files/directories in the payload and we have context in policy, these directories will get the proper context.

Comment 6 Viktor Erdelyi 2010-06-08 17:34:20 UTC
Seems to work, thanks.