Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 597589 - SELinux is preventing /usr/lib/cups/backend/mfp "read" access on libmfp.so.1.0.1.
SELinux is preventing /usr/lib/cups/backend/mfp "read" access on libmfp....
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-05-29 13:48 EDT by Viktor Erdelyi
Modified: 2010-06-08 13:34 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-05-31 09:30:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Viktor Erdelyi 2010-05-29 13:48:10 EDT

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 13:57:57 EDT
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 14:03:22 EDT
Possible filelist from the driver installer directory:
(all of them go below /usr)

Comment 3 Viktor Erdelyi 2010-05-29 14:22:23 EDT
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 14:37:26 EDT
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 09:30:39 EDT
> #============= 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 13:34:20 EDT
Seems to work, thanks.

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