Bug 1254059 - SELinux is preventing /usr/libexec/cups-pk-helper-mechanism from 'open' accesses on the file /tmp/tmpm4t6wfmi.
SELinux is preventing /usr/libexec/cups-pk-helper-mechanism from 'open' acces...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i686 Unspecified
low Severity low
: ---
: ---
Assigned To: Lukas Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-08-17 00:57 EDT by Veteran
Modified: 2015-11-20 05:56 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-20 05:56:24 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
listing of /tmp on machine B (1.58 KB, text/plain)
2015-08-27 13:09 EDT, Veteran
no flags Details

  None (edit)
Description Veteran 2015-08-17 00:57:07 EDT
Description of problem:
I was trying to set up remote CUPS printing to a USB printer on another machine on my network. This error popped up while I was setting printing up or when I was trying to print a test page
SELinux is preventing /usr/libexec/cups-pk-helper-mechanism from 'open' accesses on the file /tmp/tmpm4t6wfmi.

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

If you believe that cups-pk-helper-mechanism should be allowed open access on the tmpm4t6wfmi file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep cups-pk-helper- /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:cupsd_config_t:s0-s0:c0.c1023
Target Context                system_u:object_r:tmp_t:s0
Target Objects                /tmp/tmpm4t6wfmi [ file ]
Source                        cups-pk-helper-
Source Path                   /usr/libexec/cups-pk-helper-mechanism
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           cups-pk-helper-0.2.5-5.fc21.i686
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-105.20.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.1.4-100.fc21.i686+PAE #1 SMP Tue
                              Aug 4 05:10:46 UTC 2015 i686 i686
Alert Count                   2
First Seen                    2015-08-17 00:25:58 EDT
Last Seen                     2015-08-17 00:50:20 EDT
Local ID                      35b13e51-a080-4ae7-8041-b00cdf839090

Raw Audit Messages
type=AVC msg=audit(1439787020.554:3151): avc:  denied  { open } for  pid=21994 comm="cups-pk-helper-" path="/tmp/tmpm4t6wfmi" dev="dm-7" ino=43 scontext=system_u:system_r:cupsd_config_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmp_t:s0 tclass=file permissive=0

type=SYSCALL msg=audit(1439787020.554:3151): arch=i386 syscall=open success=no exit=EACCES a0=9e4fba8 a1=8000 a2=0 a3=0 items=0 ppid=1 pid=21994 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=cups-pk-helper- exe=/usr/libexec/cups-pk-helper-mechanism subj=system_u:system_r:cupsd_config_t:s0-s0:c0.c1023 key=(null)

Hash: cups-pk-helper-,cupsd_config_t,tmp_t,file,open

Version-Release number of selected component:

Additional info:
reporter:       libreport-2.3.0
hashmarkername: setroubleshoot
kernel:         4.1.4-100.fc21.i686+PAE
type:           libreport
Comment 1 Daniel Walsh 2015-08-18 09:30:09 EDT
Any idea how this tmp file got there?  Theoretically their should never be files labeled tmp_t?  Did you run this machine in permissive mode for a while?
Comment 2 Veteran 2015-08-27 12:49:15 EDT
No I only use permissive mode temporarily when troubleshooting, which wasn't the case here.

I was in vnc on a machine B on my network, printing to machine A on my network which had the printer attached. I noticed the Setroubleshoot alert afterwards, on machine B.
Comment 3 Veteran 2015-08-27 13:09:04 EDT
Created attachment 1067838 [details]
listing of /tmp on machine B

I am confused about the statement that there should be no files labeled tmp_t, because there are a number of them.

$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      29
Comment 4 Veteran 2015-08-27 13:31:32 EDT
Also, not sure this helps but that tmp file is a printer PPD:

# file tmpm4t6wfmi
tmpm4t6wfmi: PPD file, version "4.3"
Comment 5 Lukas Vrabec 2015-08-31 11:43:37 EDT
Can you catch which process creates this files?
Comment 6 Miroslav Grepl 2015-09-11 04:43:16 EDT

[veteran@machine_B tmp]$ ls -Z
drwx------. root  root  system_u:object_r:lost_found_t:s0 lost+found
-rw-rw-r--. veteran veteran unconfined_u:object_r:user_tmp_t:s0 newfile

is OK. But all these tmpXXX files labeled as tmp_t are a bug here.

Any chance to clean these tmpXXX files and try to reproduce it in enforcing mode on both machines?
Comment 7 Fedora End Of Life 2015-11-04 10:24:05 EST
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 EOL if it remains open with a Fedora  'version'
of '21'.

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 21 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 8 Veteran 2015-11-10 11:42:32 EST
I have updated the machine to fc22 so I can no longer provide info
Comment 9 Miroslav Grepl 2015-11-20 05:56:24 EST
(In reply to Veteran from comment #8)
> I have updated the machine to fc22 so I can no longer provide info

Thank you for testing.

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