Subject: Re: [PATCH v2] net: don't allow CAP_NET_ADMIN to load non-netdev kernel modules

From: Stephen Hemminger <[email-masked]>
Date: Thu, 24 Mar 2011 14:39:44 -0700

On Thu, 24 Mar 2011 15:26:34 -0500
"Serge E. Hallyn" <[email-masked]> wrote:

> Quoting Ben Hutchings ([email-masked]):
> > On Thu, 2011-03-24 at 14:03 -0400, Eric Paris wrote:
> > > Not quite.  SELinux logs every time an operation is denied.  This patch
> > > means that every time a module is requested which does not exist as
> 
> Ah.  I see.
> 
> ...
> 
> > > I think there are 3 possibilities:
> 
> ...(3)
> 
> > > Figure out a way to stop the calls to "reg" "wifi0" and "virbr0" if they
> > > don't exist.
> > >
> > > I feel like the last one is the best way, but I don't know what a
> > > solution could look like....
> > 
> > This really has to be done in userland, where these names are being
> > invented.  Though I suspect the usual way to check whether an interface
> > exists would be SIOCGIFINDEX, which calls dev_load()!  An alternate
> > would be to check whether /sys/class/net/<name> exists, but I seem to
> > recall that /sys/class is somewhat deprecated.
> 
> Of course this will mean pain for users until distributions have
> updated to userspace which is doing this, but yeah, this clearly seems
> like the best way.  (And the only sane one.)
> 

This breaks for many of the tunneling protocols, that rely on
autoload for names like "sit0"