Commit 9d43a18c authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by David S. Miller

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: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 337da3e3
...@@ -1791,8 +1791,6 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr) ...@@ -1791,8 +1791,6 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
tun = tfile->detached; tun = tfile->detached;
if (!tun) if (!tun)
ret = -EINVAL; ret = -EINVAL;
else if (tun_not_capable(tun))
ret = -EPERM;
else else
ret = tun_attach(tun, file); ret = tun_attach(tun, file);
} else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment