From: Michael S. Tsirkin Date: Thu, 10 Jan 2013 01:31:08 +0000 (+0000) Subject: tun: avoid owner checks on IFF_ATTACH_QUEUE X-Git-Tag: v3.8-rc4~29^2~12 X-Git-Url: http://pileus.org/git/?p=~andy%2Flinux;a=commitdiff_plain;h=9d43a18c6e8f868111b983388feeedaea7594fef tun: avoid owner checks on IFF_ATTACH_QUEUE 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 Reviewed-by: Stefan Hajnoczi Signed-off-by: David S. Miller --- diff --git a/drivers/net/tun.c b/drivers/net/tun.c index cf6da6efc71..99b58d86217 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -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) {