Skip to content

Commit

Permalink
tun: avoid owner checks on IFF_ATTACH_QUEUE
Browse files Browse the repository at this point in the history
At the moment, we check owner when we enable queue in tun.
This seems redundant and will break some valid uses
where fd is passed around: I think TUNSETOWNER is there
to prevent others from attaching to a persistent device not
owned by them. Here the fd is already attached,
enabling/disabling queue is more like read/write.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael S. Tsirkin authored and David S. Miller committed Jan 10, 2013
1 parent 337da3e commit 9d43a18
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
@@ -1791,8 +1791,6 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
tun = tfile->detached;
if (!tun)
ret = -EINVAL;
else if (tun_not_capable(tun))
ret = -EPERM;
else
ret = tun_attach(tun, file);
} else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {

0 comments on commit 9d43a18

Please sign in to comment.