]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
tuntap: disable preemption during XDP processing
authorJason Wang <jasowang@redhat.com>
Sat, 24 Feb 2018 03:32:25 +0000 (11:32 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 15 Mar 2018 13:28:17 +0000 (08:28 -0500)
commit7aad491b36e99668f080d0ad567e1c3b58f3af00
tree67ff94a50f03faa3b02679aae2138a5169f905c7
parentbf2b719022c3d308dc2d7c334333373306a0ee6d
tuntap: disable preemption during XDP processing

BugLink: http://bugs.launchpad.net/bugs/1755179
[ Upstream commit 23e43f07f896f8578318cfcc9466f1e8b8ab21b6 ]

Except for tuntap, all other drivers' XDP was implemented at NAPI
poll() routine in a bh. This guarantees all XDP operation were done at
the same CPU which is required by e.g BFP_MAP_TYPE_PERCPU_ARRAY. But
for tuntap, we do it in process context and we try to protect XDP
processing by RCU reader lock. This is insufficient since
CONFIG_PREEMPT_RCU can preempt the RCU reader critical section which
breaks the assumption that all XDP were processed in the same CPU.

Fixing this by simply disabling preemption during XDP processing.

Fixes: 761876c857cb ("tap: XDP support")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/net/tun.c