linux-stable/arch
Pu Lehui adebac5995 riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC
[ Upstream commit b54b600361 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:23 +01:00
..
alpha alpha: fix syscall entry in !AUDUT_SYSCALL case 2022-12-31 13:31:55 +01:00
arc
arm ARM: mmp: fix timer_read delay 2022-12-31 13:31:54 +01:00
arm64 arch: arm64: apple: t8103: Use standard "iommu" node name 2022-12-31 13:31:54 +01:00
csky
hexagon
ia64
loongarch
m68k
microblaze
mips MIPS: OCTEON: warn only once if deprecated link status is being used 2022-12-31 13:32:00 +01:00
nios2
openrisc
parisc
powerpc
riscv riscv, bpf: Emit fixed-length instructions for BPF_PSEUDO_FUNC 2022-12-31 13:32:23 +01:00
s390
sh
sparc
um
x86 x86/boot: Skip realmode init code when running as Xen PV guest 2022-12-31 13:32:16 +01:00
xtensa
.gitignore
Kconfig