android_kernel_samsung_sm8650/arch
Yonghong Song ac5671d100 bpf: Fix a bpf_jit_dump issue for x86_64 with sysctl bpf_jit_enable.
[ Upstream commit ad96f1c9138e0897bee7f7c5e54b3e24f8b62f57 ]

The sysctl net/core/bpf_jit_enable does not work now due to commit
1022a5498f ("bpf, x86_64: Use bpf_jit_binary_pack_alloc"). The
commit saved the jitted insns into 'rw_image' instead of 'image'
which caused bpf_jit_dump not dumping proper content.

With 'echo 2 > /proc/sys/net/core/bpf_jit_enable', run
'./test_progs -t fentry_test'. Without this patch, one of jitted
image for one particular prog is:

  flen=17 proglen=92 pass=4 image=0000000014c64883 from=test_progs pid=1807
  00000000: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  00000010: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  00000020: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  00000030: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  00000040: cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc
  00000050: cc cc cc cc cc cc cc cc cc cc cc cc

With this patch, the jitte image for the same prog is:

  flen=17 proglen=92 pass=4 image=00000000b90254b7 from=test_progs pid=1809
  00000000: f3 0f 1e fa 0f 1f 44 00 00 66 90 55 48 89 e5 f3
  00000010: 0f 1e fa 31 f6 48 8b 57 00 48 83 fa 07 75 2b 48
  00000020: 8b 57 10 83 fa 09 75 22 48 8b 57 08 48 81 e2 ff
  00000030: 00 00 00 48 83 fa 08 75 11 48 8b 7f 18 be 01 00
  00000040: 00 00 48 83 ff 0a 74 02 31 f6 48 bf 18 d0 14 00
  00000050: 00 c9 ff ff 48 89 77 00 31 c0 c9 c3

Fixes: 1022a5498f ("bpf, x86_64: Use bpf_jit_binary_pack_alloc")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20230609005439.3173569-1-yhs@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-28 11:12:29 +02:00
..
alpha alpha: fix R_ALPHA_LITERAL reloc for large modules 2023-03-17 08:50:31 +01:00
arc ARC: mm: fix leakage of memory allocated for PTE 2022-10-17 16:32:12 -07:00
arm ARM: dts: vexpress: add missing cache properties 2023-06-21 16:00:52 +02:00
arm64 KVM: arm64: PMU: Restore the host's PMUSERENR_EL0 2023-06-28 11:12:28 +02: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 ia64: fix an addr to taddr in huge_pte_offset() 2023-05-11 23:03:40 +09:00
loongarch LoongArch: Fix perf event id calculation 2023-06-21 16:00:54 +02:00
m68k m68k: Move signal frame following exception on 68020/030 2023-05-30 14:03:18 +01:00
microblaze kbuild: fix "cat: .version: No such file or directory" 2022-11-24 09:26:02 +09:00
mips MIPS: Prefer cc-option for additions to cflags 2023-06-21 16:01:03 +02:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 16:00:54 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-11 23:03:35 +09:00
parisc parisc: Delete redundant register definitions in <asm/assembly.h> 2023-06-21 16:01:02 +02:00
powerpc powerpc/purgatory: remove PGO flags 2023-06-21 16:00:55 +02:00
riscv riscv/purgatory: remove PGO flags 2023-06-21 16:00:55 +02:00
s390 s390/topology: honour nr_cpu_ids when adding CPUs 2023-06-09 10:34:13 +02:00
sh sh: nmi_debug: fix return value of __setup handler 2023-05-17 11:53:45 +02:00
sparc sparc: allow PM configs for sparc32 COMPILE_TEST 2023-03-10 09:33:27 +01:00
um um: harddog: fix modular build 2023-06-09 10:34:10 +02:00
x86 bpf: Fix a bpf_jit_dump issue for x86_64 with sysctl bpf_jit_enable. 2023-06-28 11:12:29 +02:00
xtensa xtensa: add __bswap{si,di}2 helpers 2023-05-30 14:03:18 +01:00
.gitignore
Kconfig ftrace: Allow WITH_ARGS flavour of graph tracer with shadow call stack 2022-12-31 13:32:45 +01:00