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

From: Serge E. Hallyn
Date: Thu Mar 24 2011 - 16:27:53 EST


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.)

thanks,
-serge

Attachment: signature.asc
Description: Digital signature