Bug 969639 - SELinux is preventing /usr/sbin/xl2tpd from 'getattr' accesses on the file /run/nm-xl2tpd.conf.7319.
SELinux is preventing /usr/sbin/xl2tpd from 'getattr' accesses on the file /r...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
17
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
abrt_hash:3c9ad4feddd17852329ac87f40e...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-01 05:13 EDT by Makoto Mizukami
Modified: 2013-06-23 23:29 EDT (History)
4 users (show)

See Also:
Fixed In Version: selinux-policy-3.10.0-170.fc17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-23 23:29:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Makoto Mizukami 2013-06-01 05:13:26 EDT
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 09:15:47 EDT
Added fixes.
Comment 2 Fedora Update System 2013-06-07 03:01:07 EDT
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 19:27:58 EDT
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-07 22:18:21 EDT
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 02:10:56 EDT
Could you please attach AVC msgs for these rules. Thank you.
Comment 6 Makoto Mizukami 2013-06-16 02:16:35 EDT
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-23 23:29:04 EDT
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.