Re: [PATCH v2] net: don't allow CAP_NET_ADMIN to load non-netdevkernel modules
From: Stephen Hemminger
Date: Thu Mar 24 2011 - 17:39:57 EST
On Thu, 24 Mar 2011 15:26:34 -0500
"Serge E. Hallyn" <serge.hallyn@xxxxxxxxxx> wrote:
> Quoting Ben Hutchings (bhutchings@xxxxxxxxxxxxxx):
> > 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"
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/