Bug 747012

Summary: SELinux is preventing /bin/systemd-tty-ask-password-agent from read access on the fifo_file 136:2.
Product: [Fedora] Fedora Reporter: Slawomir Czarko <slawomir.czarko>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, harald, johannbg, kay, lpoetter, metherid, mgrepl, mschmidt, notting, plautrba, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: selinux-policy-3.10.0-45.1.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-25 03:33:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Slawomir Czarko 2011-10-18 15:08:53 UTC
Description of problem:

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

If you believe that systemd-tty-ask-password-agent should be allowed read
access on the 136:2 fifo_file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep systemd-tty-ask /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:system_r:systemd_passwd_agent_t:s0
Target Context                unconfined_u:object_r:init_var_run_t:s0
Target Objects                136:2 [ fifo_file ]
Source                        systemd-tty-ask
Source Path                   /bin/systemd-tty-ask-password-agent
Port                          <Unknown>
Host                          larch.ezono.net
Source RPM Packages           systemd-26-10.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-39.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     larch.ezono.net
Platform                      Linux larch.ezono.net 2.6.40.6-0.fc15.i686.PAE #1
                              SMP Tue Oct 4 00:44:38 UTC 2011 i686 i686
Alert Count                   5
First Seen                    Mon Oct 17 14:07:13 2011
Last Seen                     Mon Oct 17 14:33:15 2011
Local ID                      c8f9f375-24b1-48fb-b59f-5fcc7f301016

Raw Audit Messages
type=AVC msg=audit(1318854795.241:4485): avc:  denied  { read } for  pid=26046
comm="systemd-tty-ask" name="136:2" dev=tmpfs ino=2725891
scontext=unconfined_u:system_r:systemd_passwd_agent_t:s0
tcontext=unconfined_u:object_r:init_var_run_t:s0 tclass=fifo_file


type=AVC msg=audit(1318854795.241:4485): avc:  denied  { open } for  pid=26046
comm="systemd-tty-ask" name="136:2" dev=tmpfs ino=2725891
scontext=unconfined_u:system_r:systemd_passwd_agent_t:s0
tcontext=unconfined_u:object_r:init_var_run_t:s0 tclass=fifo_file


type=SYSCALL msg=audit(1318854795.241:4485): arch=i386 syscall=open success=yes
exit=ESRCH a0=8f44080 a1=88900 a2=0 a3=bfc5c3a4 items=0 ppid=26045 pid=26046
auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts2 ses=362
comm=systemd-tty-ask exe=/bin/systemd-tty-ask-password-agent
subj=unconfined_u:system_r:systemd_passwd_agent_t:s0 key=(null)

Hash: systemd-tty-ask,systemd_passwd_agent_t,init_var_run_t,fifo_file,read

audit2allow

#============= systemd_passwd_agent_t ==============
allow systemd_passwd_agent_t init_var_run_t:fifo_file { read open };

audit2allow -R

#============= systemd_passwd_agent_t ==============
allow systemd_passwd_agent_t init_var_run_t:fifo_file { read open };


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

This was originally reported here https://bugzilla.redhat.com/show_bug.cgi?id=692459#c58

Comment 1 Daniel Walsh 2011-10-18 15:35:35 UTC
I think we should just label this directory as 

/var/run/systemd/ask-password-block(/.*)?	gen_context(system_u:object_r:systemd_device_t,s0)

Lennart is this directory in F16 going to be 

/var/run/systemd/ask-password(/.*)?	gen_context(system_u:object_r:systemd_device_t,s0)

Comment 2 Tim Waugh 2011-10-20 14:28:09 UTC
I got AVCs with selinux-policy-targeted-3.10.0-43.fc16 which went away when I downgraded to 3.10.0-40.fc16:

[   13.532756] type=1400 audit(1319114296.480:3): avc:  denied  { read } for  pid=888 comm="systemd-tty-ask" name="ask.Lay54y" dev=tmpfs ino=13454 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:systemd_passwd_var_run_t:s0 tclass=file
[   13.532776] type=1400 audit(1319114296.480:4): avc:  denied  { open } for  pid=888 comm="systemd-tty-ask" name="ask.Lay54y" dev=tmpfs ino=13454 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:systemd_passwd_var_run_t:s0 tclass=file
[   13.532803] type=1400 audit(1319114296.480:5): avc:  denied  { getattr } for  pid=888 comm="systemd-tty-ask" path="/run/systemd/ask-password/ask.Lay54y" dev=tmpfs ino=13454 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:systemd_passwd_var_run_t:s0 tclass=file
[   13.533099] type=1400 audit(1319114296.481:6): avc:  denied  { write } for  pid=888 comm="systemd-tty-ask" name="sck.11809695099838145350" dev=tmpfs ino=13456 scontext=system_u:system_r:systemd_passwd_agent_t:s0 tcontext=system_u:object_r:systemd_passwd_var_run_t:s0 tclass=sock_file

Comment 3 Miroslav Grepl 2011-10-20 15:29:29 UTC
Fixed in selinux-policy-targeted-3.10.0-44.fc16

Comment 4 Fedora Update System 2011-10-20 18:55:49 UTC
selinux-policy-3.10.0-45.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/FEDORA-2011-14618

Comment 5 Fedora Update System 2011-10-22 00:10:49 UTC
Package selinux-policy-3.10.0-45.1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.10.0-45.1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14618
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-10-25 03:33:59 UTC
selinux-policy-3.10.0-45.1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.