]> www.infradead.org Git - nvme.git/commit
tun: Assign missing bpf_net_context.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 4 Jul 2024 14:48:15 +0000 (16:48 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 5 Jul 2024 23:59:37 +0000 (16:59 -0700)
commitfecef4cd42c689a200bdd39e6fffa71475904bc1
tree77e6bcb7cb0d8cb5b656646e071fc92d1b13bf7a
parent3b2aef99221d395ce37efa426d7b50e7dcd621d6
tun: Assign missing bpf_net_context.

During the introduction of struct bpf_net_context handling for
XDP-redirect, the tun driver has been missed.
Jakub also pointed out that there is another call chain to
do_xdp_generic() originating from netif_receive_skb() and drivers may
use it outside from the NAPI context.

Set the bpf_net_context before invoking BPF XDP program within the TUN
driver. Set the bpf_net_context also in do_xdp_generic() if a xdp
program is available.

Reported-by: syzbot+0b5c75599f1d872bea6f@syzkaller.appspotmail.com
Reported-by: syzbot+5ae46b237278e2369cac@syzkaller.appspotmail.com
Reported-by: syzbot+c1e04a422bbc0f0f2921@syzkaller.appspotmail.com
Fixes: 401cb7dae8130 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20240704144815.j8xQda5r@linutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/tun.c
net/core/dev.c