diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-01-09 20:31:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-10 17:26:43 -0500 |
commit | 9d43a18c6e8f868111b983388feeedaea7594fef (patch) | |
tree | dd0785b9710e271f876eb72063c803ca13b69e74 /drivers/net/tun.c | |
parent | 337da3e3f5564c5d8ca0962a0338d8c561c9f9c7 (diff) |
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 <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index cf6da6efc71a..99b58d862174 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) | |||
1791 | tun = tfile->detached; | 1791 | tun = tfile->detached; |
1792 | if (!tun) | 1792 | if (!tun) |
1793 | ret = -EINVAL; | 1793 | ret = -EINVAL; |
1794 | else if (tun_not_capable(tun)) | ||
1795 | ret = -EPERM; | ||
1796 | else | 1794 | else |
1797 | ret = tun_attach(tun, file); | 1795 | ret = tun_attach(tun, file); |
1798 | } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { | 1796 | } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) { |