]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Fix an endianness issue in bpf_syscall_macro test
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 9 Feb 2022 02:17:36 +0000 (03:17 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 9 Feb 2022 05:16:14 +0000 (21:16 -0800)
commitd67a8e036d21e21aa9a59ee4c609e4115c9ccec7
tree6019d00a6922a9e999d7bd626f71bd09e0adf257
parent3a8279959a1a76c0e6c01b46af092e15d5b25844
selftests/bpf: Fix an endianness issue in bpf_syscall_macro test

bpf_syscall_macro reads a long argument into an int variable, which
produces a wrong value on big-endian systems. Fix by reading the
argument into an intermediate long variable first.

Fixes: 5f8747829cbb ("selftests/bpf: Add a test to confirm PT_REGS_PARM4_SYSCALL")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220209021745.2215452-2-iii@linux.ibm.com
tools/testing/selftests/bpf/progs/bpf_syscall_macro.c