Re: Allow group ownership of TUN/TAP devices.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Tokarev
Date: Tuesday, March 24, 2009 - 11:10 am

[Again, resurrecting an old thread...
  lkml added -- this is a policy issue, so to say]

Guido Günther wrote at Thu, 5 Feb 2009 11:54:57 +0100:

It's a bit worse than that.  I.e., there's exactly 2 problems here.

First, currently tun driver only checks primary gid and not any
supplementary gids (this is what my one-line patch addressed).

And second, if both gid and uid is specified for the given tun
device, BOTH should match.  I.e, I can be "owner"(*) of the device
in question, but if my current gid does not match, I still can't
use it.  This one is interesting: currently, one can grant a tun
device to a given "incarnation" of an uid, that is, suppose we've
two processes running under the same uid but with different gids -
this way, I can grant the device to only one of them.  But here,
why to grant to uid anyway, just use that gid.. I think ;)

(*) note the quotes around "owner" here because, unlike with, say,
files, I can't do anything I want with the network device, I only
have very limited set of operations.


And this is the question which's the reason why I added Cc LKML.

My point of view is that it's a bug in original design, it was done
not so long ago (around mid-2007, well, 2+ years isn't that short
anymore, right?), this feature isn't used much currently (because
it's less known than, say, user ownership and because of this very
bug), and because fixing it by introducing another mechanism nearby
is even more ugly (IMHO anyway).

The lack of (wide) usage (or anyway, I think that this feature is
not widely used) -- currently, due to the requirement that it must
be primary group, it's almost impossible to use.  A device gets
granted to a user instead, or the group in question becomes his
primary group, without granting it to others.  In most cases anyway.
This is in addition to the fact that group ownership for a net
device isn't very useful to begin with, because it's not intended
for "collective" use in the first place.

But the question remains -- what to do with this mess.

I almost forgot about this issue, -- I added the patch to the
local kernel package and it worked since.  But today I tried
to compile 2.6.29, the patch didn't apply so I skipped it the
first try, and almost immediately trapped to this issue again,
because my scripts and my kvm stuff stopped working... ;)

Thanks!

/mjt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
re: Allow group ownership of TUN/TAP devices., Michael Tokarev, (Mon Feb 2, 7:18 am)
Re: Allow group ownership of TUN/TAP devices., Michael Tokarev, (Mon Feb 2, 7:44 am)
Re: Allow group ownership of TUN/TAP devices., David Miller, (Tue Feb 3, 12:35 am)
Re: Allow group ownership of TUN/TAP devices., Guido , (Thu Feb 5, 3:54 am)
Re: Allow group ownership of TUN/TAP devices., Michael Tokarev, (Tue Mar 24, 11:10 am)