]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: refuse to re-attach to different tun_struct
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 9 Jan 2013 21:59:48 +0000 (21:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jan 2013 22:24:10 +0000 (14:24 -0800)
commitf3dba4f243c4cf90a426ce90f7ee35f8a206ce5e
treecc7e9eed80682c95c8a0446b6d92220703aa8c2a
parent891ba891056d883c4f4b96985f2cd6cfe1515ff0
tuntap: refuse to re-attach to different tun_struct

Multiqueue tun devices support detaching a tun_file from its tun_struct
and re-attaching at a later point in time.  This allows users to disable
a specific queue temporarily.

ioctl(TUNSETIFF) allows the user to specify the network interface to
attach by name.  This means the user can attempt to attach to interface
"B" after detaching from interface "A".

The driver is not designed to support this so check we are re-attaching
to the right tun_struct.  Failure to do so may lead to oops.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c