Bug 748724 - No SELinux policies for xl2tpd
Summary: No SELinux policies for xl2tpd
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: xl2tpd
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Paul Wouters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 833557
TreeView+ depends on / blocked
 
Reported: 2011-10-25 07:22 UTC by Steven Bakker
Modified: 2012-07-05 23:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 833557 (view as bug list)
Environment:
Last Closed: 2012-07-05 23:33:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steven Bakker 2011-10-25 07:22:16 UTC
Description of problem:

When SELinux is enabled, xl2tpd fails to run due to insufficient privileges. It appears there is no SELinux policy shipped with xl2tpd.

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

xl2tpd-1.3.1-1.fc16.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Start xl2tpd
2. Try to set up a tunnel
  
Actual results:

Fails (initially even fails to start up daemon), logs in /var/log/audit/audit.log and /var/log/messages about SELinux blockage.

Expected results:

A ppp0 interface.

Additional info:

Comment 1 Steven Bakker 2011-10-26 06:34:32 UTC
The following policy seems to get xl2tpd into something like a working state (it then fails to start pppd due to lack of legacy PTYs in the kernel):

--
module mypol 1.0;

require {
	type l2tpd_t;
	type ptmx_t;
	type unreserved_port_t;
	type var_run_t;
	class file { read unlink };
	class chr_file { read write ioctl open };
	class udp_socket name_bind;
}

#============= l2tpd_t ==============
allow l2tpd_t ptmx_t:chr_file { read write ioctl open };
allow l2tpd_t unreserved_port_t:udp_socket name_bind;
allow l2tpd_t var_run_t:file { read unlink };
--

Comment 2 Steven Bakker 2011-10-31 15:36:44 UTC
Scratch that last bit about the kernel. It complains about the legacy PTYs because it is falling back to them. In other words, it cannot open a PTY through the regular interface. Definitely SELinux-related, since it works fine if I turn off SELinux completely. No idea what policy lines are needed here, though.

Comment 3 paul 2012-01-24 16:15:24 UTC
(In reply to comment #0)

I have almost exactly the same problem - xl2tpd-1.3.1-1.fc16.i686

Similar setup in Fedora 8 works without problem.

Jan 24 20:20:35 p320g--f16 xl2tpd[7002]: Connection established to 192.168.0.98, 1701.  Local: 32045, Remote: 1 (ref=0/0).  LNS session is 'default'
Jan 24 20:20:35 p320g--f16 xl2tpd[7002]: getPtyMaster_ptmx: unable to open /dev/ptmx to allocate pty
Jan 24 20:20:35 p320g--f16 xl2tpd[7002]: getPtyMaster: failed to use pts -- using legacy ptys
Jan 24 20:20:35 p320g--f16 xl2tpd[7002]: getPtyMaster_pty: No more free pseudo-tty's
Jan 24 20:20:35 p320g--f16 xl2tpd[7002]: start_pppd: unable to allocate pty, abandoning!    


> Description of problem:
> 
> When SELinux is enabled, xl2tpd fails to run due to insufficient privileges. It
> appears there is no SELinux policy shipped with xl2tpd.
> 
> Version-Release number of selected component (if applicable):
> 
> xl2tpd-1.3.1-1.fc16.x86_64
> 
> How reproducible:
> 
> Always
> 
> Steps to Reproduce:
> 1. Start xl2tpd
> 2. Try to set up a tunnel
> 
> Actual results:
> 
> Fails (initially even fails to start up daemon), logs in
> /var/log/audit/audit.log and /var/log/messages about SELinux blockage.
> 
> Expected results:
> 
> A ppp0 interface.
> 
> Additional info:

Comment 4 Paul Wouters 2012-04-26 20:21:49 UTC
note there is a policy in fedora, but not in rhel6

Comment 5 Miroslav Grepl 2012-04-27 09:58:25 UTC
Then please open a new bug for RHEL6.

Comment 6 Paul Wouters 2012-06-15 22:33:29 UTC
dwalsh: has the xl2tpd policy update made it to rhel/epel yet?

Comment 7 Daniel Walsh 2012-06-18 20:46:01 UTC
Not in RHEL, did you open a bug requesting it?

Comment 8 Paul Wouters 2012-06-19 18:55:04 UTC
I did now, and added selinux policy patches. See:
https://bugzilla.redhat.com/show_bug.cgi?id=833557

Comment 9 Paul Wouters 2012-07-05 23:33:47 UTC
closing bug as the policy is there now in Fedora


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