From: Paul Moore <paul.moore@hp.com>
To: russell@coker.com.au
Cc: Stephen Smalley <sds@epoch.ncsc.mil>, "SE-Linux" <selinux@tycho.nsa.gov>
Subject: Re: tun/tap and SE Linux in 2.6.32
Date: Wed, 9 Dec 2009 15:48:03 -0500 [thread overview]
Message-ID: <200912091548.03369.paul.moore@hp.com> (raw)
In-Reply-To: <200912091232.26387.russell@coker.com.au>
On Tuesday 08 December 2009 08:32:24 pm Russell Coker wrote:
> ---------- Forwarded Message ----------
>
> Subject: selinux permissive blocking tun/tap device creation in v2.6.32
> Date: Wed, 9 Dec 2009
> From: Andrew Worsley <amworsley@gmail.com>
> To: luv-main@luv.asn.au
>
> I upgraded to the v2.6.32 kernel and I found tunctl would fail with
> the ioctl TUNSETIFF rejected with an EINVAL. A real pain when running
> vpn and kvms which use these.
>
> I don't know where to go from this - so directions as to where to post
> / look would be appreciated but at least I can now create tap
> interfaces.
>
> I am looking for suggestions where I should post this to find a fix or
> other better work around than merely commenting out this code...
>
> Andrew
>
> I eventually traced this via recompiling the tun module with tracing
> to this code:
>
>
> printk(KERN_INFO "tun: tun_set_iff () 10\n");
> if (!capable(CAP_NET_ADMIN))
> return -EPERM;
> printk(KERN_INFO "tun: tun_set_iff () 11\n");
> #if 0
> err = security_tun_dev_create();
> if (err < 0)
> return err;
> #endif
>
> printk(KERN_INFO "tun: tun_set_iff () 12\n");
> /* Set dev type */
> if (ifr->ifr_flags & IFF_TUN) {
> /* TUN device */
>
> in drivers/net/tun.c (commenting out the above allows the tunctl
> command to work!)
I imagine this is because the original reporter is using a SELinux policy
without the new TUN socket classes/permissions (which is likely the common
case at this point). The unknown class/permission handling that Eric added
_should_ protect us from this - Russel do you have any more information about
the distribution and policy in use here?
--
paul moore
linux @ hp
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2009-12-09 20:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-09 1:32 tun/tap and SE Linux in 2.6.32 Russell Coker
2009-12-09 20:48 ` Paul Moore [this message]
2009-12-09 20:56 ` Russell Coker
2009-12-09 21:26 ` Stephen Smalley
2009-12-09 21:45 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200912091548.03369.paul.moore@hp.com \
--to=paul.moore@hp.com \
--cc=russell@coker.com.au \
--cc=sds@epoch.ncsc.mil \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.