]> git.baikalelectronics.ru Git - kernel.git/commit
tuntap: forbid changing mq flag for persistent device
authorJason Wang <jasowang@redhat.com>
Tue, 28 May 2013 18:32:11 +0000 (18:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2013 07:21:32 +0000 (00:21 -0700)
commit90dd8afb17a04ae1b9c14fad8ae967eb2796f485
treeccffbffdcb079b492082a8e8f0b73b446b238d8c
parent5ea79986762b0e0cf9491fb19f04bee15bd366c2
tuntap: forbid changing mq flag for persistent device

We currently allow changing the mq flag (IFF_MULTI_QUEUE) for a persistent
device. This will result a mismatch between the number the queues in netdev and
tuntap. This is because we only allocate a 1q netdevice when IFF_MULTI_QUEUE was
not specified, so when we set the IFF_MULTI_QUEUE and try to attach more queues
later, netif_set_real_num_tx_queues() may fail which result a single queue
netdevice with multiple sockets attached.

Solve this by disallowing changing the mq flag for persistent device.

Bug was introduced by commit 9a476b6b418290cda81f87c7f717446f8c8898b6
(tuntap: reduce memory using of queues).

Reported-by: Sriram Narasimhan <sriram.narasimhan@hp.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c