Bug 969639 - SELinux is preventing /usr/sbin/xl2tpd from 'getattr' accesses on the file /run/nm-xl2tpd.conf.7319.
Summary: SELinux is preventing /usr/sbin/xl2tpd from 'getattr' accesses on the file /r...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:3c9ad4feddd17852329ac87f40e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-01 09:13 UTC by Makoto Mizukami
Modified: 2013-06-24 03:29 UTC (History)
4 users (show)

Fixed In Version: selinux-policy-3.10.0-170.fc17
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-24 03:29:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Makoto Mizukami 2013-06-01 09:13:26 UTC
Description of problem:
Default NetworkManager-l2tp configuration prevent users from using xl2tpd and SELinux simultaneously.
SELinux is preventing /usr/sbin/xl2tpd from 'getattr' accesses on the file /run/nm-xl2tpd.conf.7319.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/run/nm-xl2tpd.conf.7319 default label should be var_run_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /run/nm-xl2tpd.conf.7319

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that xl2tpd should be allowed getattr access on the nm-xl2tpd.conf.7319 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 xl2tpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:l2tpd_t:s0
Target Context                system_u:object_r:NetworkManager_var_run_t:s0
Target Objects                /run/nm-xl2tpd.conf.7319 [ file ]
Source                        xl2tpd
Source Path                   /usr/sbin/xl2tpd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xl2tpd-1.3.1-9.fc17.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.10.0-169.fc17.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.8.13-100.fc17.x86_64 #1 SMP Mon
                              May 13 13:36:17 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-06-01 18:01:51 JST
Last Seen                     2013-06-01 18:08:00 JST
Local ID                      6c7ad347-5f31-44d9-a49c-0f27aee26537

Raw Audit Messages
type=AVC msg=audit(1370077680.415:450): avc:  denied  { getattr } for  pid=7321 comm="xl2tpd" path="/run/nm-xl2tpd.conf.7319" dev="tmpfs" ino=84228 scontext=system_u:system_r:l2tpd_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file


type=SYSCALL msg=audit(1370077680.415:450): arch=x86_64 syscall=fstat success=yes exit=0 a0=3 a1=7fff6c084400 a2=7fff6c084400 a3=0 items=0 ppid=7319 pid=7321 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=xl2tpd exe=/usr/sbin/xl2tpd subj=system_u:system_r:l2tpd_t:s0 key=(null)

Hash: xl2tpd,l2tpd_t,NetworkManager_var_run_t,file,getattr

audit2allow

#============= l2tpd_t ==============
#!!!! This avc is allowed in the current policy

allow l2tpd_t NetworkManager_var_run_t:file getattr;

audit2allow -R

#============= l2tpd_t ==============
#!!!! This avc is allowed in the current policy

allow l2tpd_t NetworkManager_var_run_t:file getattr;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.13-100.fc17.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-06-04 13:15:47 UTC
Added fixes.

Comment 2 Fedora Update System 2013-06-07 07:01:07 UTC
selinux-policy-3.10.0-170.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-170.fc17

Comment 3 Fedora Update System 2013-06-07 23:27:58 UTC
Package selinux-policy-3.10.0-170.fc17:
* should fix your issue,
* was pushed to the Fedora 17 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-170.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10302/selinux-policy-3.10.0-170.fc17
then log in and leave karma (feedback).

Comment 4 Makoto Mizukami 2013-06-08 02:18:21 UTC
Tested the testing package and it WFM for xl2tpd.

However, as I mentioned in https://admin.fedoraproject.org/updates/FEDORA-2013-10302/selinux-policy-3.10.0-170.fc17, further permissions for NetworkManager_t and pppd_t are needed in order for nm-l2tp to work fine.

Following is a result of "# audit2allow -b" which I ran just after booting and starting L2TP VPN (some empty breaks are ommited):

#============= NetworkManager_t ==============
allow NetworkManager_t l2tp_port_t:udp_socket name_bind;
allow NetworkManager_t l2tpd_t:process signal;
allow NetworkManager_t l2tpd_t:process sigkill;

#============= pppd_t ==============
allow pppd_t NetworkManager_var_run_t:file read;

So is there any chance to commit them into the current testing package?

Comment 5 Miroslav Grepl 2013-06-14 06:10:56 UTC
Could you please attach AVC msgs for these rules. Thank you.

Comment 6 Makoto Mizukami 2013-06-16 06:16:35 UTC
Are those required lines?

type=AVC msg=audit(1371363112.913:153): avc:  denied  { name_bind } for  pid=2362 comm="nm-l2tp-service" src=1701 scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:object_r:l2tp_port_t:s0 tclass=udp_socket
type=AVC msg=audit(1371363115.529:154): avc:  denied  { read } for  pid=2372 comm="pppd" name="nm-ppp-options.xl2tpd.2362" dev="tmpfs" ino=30119 scontext=system_u:system_r:pppd_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file
type=AVC msg=audit(1371363115.529:154): avc:  denied  { open } for  pid=2372 comm="pppd" path="/run/nm-ppp-options.xl2tpd.2362" dev="tmpfs" ino=30119 scontext=system_u:system_r:pppd_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file
type=AVC msg=audit(1371363115.529:155): avc:  denied  { getattr } for  pid=2372 comm="pppd" path="/run/nm-ppp-options.xl2tpd.2362" dev="tmpfs" ino=30119 scontext=system_u:system_r:pppd_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=file
type=AVC msg=audit(1371363128.393:156): avc:  denied  { signal } for  pid=2362 comm="nm-l2tp-service" scontext=system_u:system_r:NetworkManager_t:s0 tcontext=system_u:system_r:l2tpd_t:s0 tclass=process

Comment 7 Fedora Update System 2013-06-24 03:29:04 UTC
selinux-policy-3.10.0-170.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.


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