bpf, devmap: Add missing RCU read lock on flush
authorToshiaki Makita <toshiaki.makita1@gmail.com>
Fri, 14 Jun 2019 08:20:15 +0000 (17:20 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:11:11 +0000 (08:11 +0200)
commit4c2ce7addda888c17db7625a07e79b24fdce6211
tree6faf4b16942d9f1856640ef8888946e8a9eb4e73
parentab44f8bcf2e5bc961fc182fa5db0aff81fe39726
bpf, devmap: Add missing RCU read lock on flush

[ Upstream commit 86723c8640633bee4b4588d3c7784ee7a0032f65 ]

.ndo_xdp_xmit() assumes it is called under RCU. For example virtio_net
uses RCU to detect it has setup the resources for tx. The assumption
accidentally broke when introducing bulk queue in devmap.

Fixes: 5d053f9da431 ("bpf: devmap prepare xdp frames for bulking")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/bpf/devmap.c