Skip to content

Commit 3f8ad18

Browse files
Yonghong SongAlexei Starovoitov
authored andcommitted
selftests/bpf: Fix verifier_private_stack test failure
Several verifier_private_stack tests failed with latest bpf-next. For example, for 'Private stack, single prog' subtest, the jitted code: func #0: 0: f3 0f 1e fa endbr64 4: 0f 1f 44 00 00 nopl (%rax,%rax) 9: 0f 1f 00 nopl (%rax) c: 55 pushq %rbp d: 48 89 e5 movq %rsp, %rbp 10: f3 0f 1e fa endbr64 14: 49 b9 58 74 8a 8f 7d 60 00 00 movabsq $0x607d8f8a7458, %r9 1e: 65 4c 03 0c 25 28 c0 48 87 addq %gs:-0x78b73fd8, %r9 27: bf 2a 00 00 00 movl $0x2a, %edi 2c: 49 89 b9 00 ff ff ff movq %rdi, -0x100(%r9) 33: 31 c0 xorl %eax, %eax 35: c9 leave 36: e9 20 5d 0f e1 jmp 0xffffffffe10f5d5b The insn 'addq %gs:-0x78b73fd8, %r9' does not match the expected regex 'addq %gs:0x{{.*}}, %r9' and this caused test failure. Fix it by changing '%gs:0x{{.*}}' to '%gs:{{.*}}' to accommodate the possible negative offset. A few other subtests are fixed in a similar way. Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Link: https://lore.kernel.org/r/20250331033828.365077-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 14d8435 commit 3f8ad18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/bpf/progs/verifier_private_stack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ __description("Private stack, single prog")
2727
__success
2828
__arch_x86_64
2929
__jited(" movabsq $0x{{.*}}, %r9")
30-
__jited(" addq %gs:0x{{.*}}, %r9")
30+
__jited(" addq %gs:{{.*}}, %r9")
3131
__jited(" movl $0x2a, %edi")
3232
__jited(" movq %rdi, -0x100(%r9)")
3333
__naked void private_stack_single_prog(void)
@@ -74,7 +74,7 @@ __success
7474
__arch_x86_64
7575
/* private stack fp for the main prog */
7676
__jited(" movabsq $0x{{.*}}, %r9")
77-
__jited(" addq %gs:0x{{.*}}, %r9")
77+
__jited(" addq %gs:{{.*}}, %r9")
7878
__jited(" movl $0x2a, %edi")
7979
__jited(" movq %rdi, -0x200(%r9)")
8080
__jited(" pushq %r9")
@@ -122,7 +122,7 @@ __jited(" pushq %rbp")
122122
__jited(" movq %rsp, %rbp")
123123
__jited(" endbr64")
124124
__jited(" movabsq $0x{{.*}}, %r9")
125-
__jited(" addq %gs:0x{{.*}}, %r9")
125+
__jited(" addq %gs:{{.*}}, %r9")
126126
__jited(" pushq %r9")
127127
__jited(" callq")
128128
__jited(" popq %r9")

0 commit comments

Comments
 (0)