linux-stable/arch
Pu Lehui b54b600361 riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC
For BPF_PSEUDO_FUNC instruction, verifier will refill imm with
correct addresses of bpf_calls and then run last pass of JIT.
Since the emit_imm of RV64 is variable-length, which will emit
appropriate length instructions accorroding to the imm, it may
broke ctx->offset, and lead to unpredictable problem, such as
inaccurate jump. So let's fix it with fixed-length instructions.

Fixes: 69c087ba62 ("bpf: Add bpf_for_each_map_elem() helper")
Suggested-by: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Pu Lehui <pulehui@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Acked-by: Björn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/bpf/20221206091410.1584784-1-pulehui@huaweicloud.com
2022-12-06 20:59:27 +01:00
..
alpha asm-generic: arch/alpha regression fix for 6.1 2022-10-14 13:47:42 -07:00
arc ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
csky - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
hexagon - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
ia64 - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
loongarch LoongArch: Fix unsigned comparison with less than zero 2022-11-21 19:02:57 +08:00
m68k - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
microblaze kbuild: fix "cat: .version: No such file or directory" 2022-11-24 09:26:02 +09:00
mips Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-17 18:30:39 -08:00
nios2 nios2: add FORCE for vmlinuz.gz 2022-11-27 08:28:41 +09:00
openrisc OpenRISC 6.1 Updates 2022-10-15 16:47:33 -07:00
parisc parisc: Avoid printing the hardware path twice 2022-10-31 15:37:14 +01:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
riscv riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC 2022-12-06 20:59:27 +01:00
s390 s390 updates for 6.1-rc7 2022-11-25 12:37:24 -08:00
sh - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
sparc net: remove skb->vlan_present 2022-11-11 18:18:05 -08:00
um Random number generator fixes for Linux 6.1-rc1. 2022-10-16 15:27:07 -07:00
x86 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
xtensa - hfs and hfsplus kmap API modernization from Fabio Francesco 2022-10-12 11:00:22 -07:00
.gitignore
Kconfig - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00