diff options
| author | 2024-08-02 14:10:55 +0200 | |
|---|---|---|
| committer | 2024-08-02 14:10:55 +0200 | |
| commit | 4436e6da008fee87d54c038e983e5be9a6baf8fb (patch) | |
| tree | 265a15efcf6f17e0e32e258d66b274fc5cad41d4 /net/core/lwt_bpf.c | |
| parent | x86/mm: Cleanup prctl_enable_tagged_addr() nr_bits error checking (diff) | |
| parent | Linux 6.11-rc1 (diff) | |
| download | wireguard-linux-4436e6da008fee87d54c038e983e5be9a6baf8fb.tar.xz wireguard-linux-4436e6da008fee87d54c038e983e5be9a6baf8fb.zip | |
Merge branch 'linus' into x86/mm
Bring x86 and selftests up to date
Diffstat (limited to 'net/core/lwt_bpf.c')
| -rw-r--r-- | net/core/lwt_bpf.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c index 4a0797f0a154..afb05f58b64c 100644 --- a/net/core/lwt_bpf.c +++ b/net/core/lwt_bpf.c @@ -38,13 +38,14 @@ static inline struct bpf_lwt *bpf_lwt_lwtunnel(struct lwtunnel_state *lwt) static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt, struct dst_entry *dst, bool can_redirect) { + struct bpf_net_context __bpf_net_ctx, *bpf_net_ctx; int ret; - /* Migration disable and BH disable are needed to protect per-cpu - * redirect_info between BPF prog and skb_do_redirect(). + /* Disabling BH is needed to protect per-CPU bpf_redirect_info between + * BPF prog and skb_do_redirect(). */ - migrate_disable(); local_bh_disable(); + bpf_net_ctx = bpf_net_ctx_set(&__bpf_net_ctx); bpf_compute_data_pointers(skb); ret = bpf_prog_run_save_cb(lwt->prog, skb); @@ -77,8 +78,8 @@ static int run_lwt_bpf(struct sk_buff *skb, struct bpf_lwt_prog *lwt, break; } + bpf_net_ctx_clear(bpf_net_ctx); local_bh_enable(); - migrate_enable(); return ret; } |
