From: Jakub Kicinski Date: Thu, 2 May 2024 19:05:13 +0000 (-0700) Subject: Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e958da0ddbe831197a0023251880a4a09d5ba268;p=linux.git Merge git://git./linux/kernel/git/netdev/net Cross-merge networking fixes after downstream PR. Conflicts: include/linux/filter.h kernel/bpf/core.c 66e13b615a0c ("bpf: verifier: prevent userspace memory access") d503a04f8bc0 ("bpf: Add support for certain atomics in bpf_arena to x86 JIT") https://lore.kernel.org/all/20240429114939.210328b0@canb.auug.org.au/ No adjacent changes. Signed-off-by: Jakub Kicinski --- e958da0ddbe831197a0023251880a4a09d5ba268 diff --cc include/linux/filter.h index 7a27f19bf44d0,219ee7a768744..d5fea03cb6e61 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@@ -1000,7 -963,7 +1000,8 @@@ bool bpf_jit_supports_far_kfunc_call(vo bool bpf_jit_supports_exceptions(void); bool bpf_jit_supports_ptr_xchg(void); bool bpf_jit_supports_arena(void); +bool bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena); + u64 bpf_arch_uaddress_limit(void); void arch_bpf_stack_walk(bool (*consume_fn)(void *cookie, u64 ip, u64 sp, u64 bp), void *cookie); bool bpf_helper_changes_pkt_data(void *func); diff --cc kernel/bpf/core.c index 95c7fd093e556,1ea5ce5bb5993..192f67dd1f251 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@@ -2965,11 -2942,15 +2965,20 @@@ bool __weak bpf_jit_supports_arena(void return false; } +bool __weak bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena) +{ + return false; +} + + u64 __weak bpf_arch_uaddress_limit(void) + { + #if defined(CONFIG_64BIT) && defined(CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE) + return TASK_SIZE; + #else + return 0; + #endif + } + /* Return TRUE if the JIT backend satisfies the following two conditions: * 1) JIT backend supports atomic_xchg() on pointer-sized words. * 2) Under the specific arch, the implementation of xchg() is the same