Thread (6 messages) 6 messages, 3 authors, 2024-12-05

Re: [PATCH v2] selftests/ftrace: adjust offset for kprobe syntax error test

From: Shuah Khan <skhan@linuxfoundation.org>
Date: 2024-12-05 16:06:45
Also in: linux-kselftest, linux-trace-kernel, lkml

On 12/3/24 18:20, Steven Rostedt wrote:
On Tue, 3 Dec 2024 18:01:06 -0700
Shuah Khan [off-list ref] wrote:
quoted
On 12/2/24 12:41, Steven Rostedt wrote:
quoted
On Sat, 30 Nov 2024 01:56:21 +0530
Hari Bathini [off-list ref] wrote:
   
quoted
In 'NOFENTRY_ARGS' test case for syntax check, any offset X of
`vfs_read+X` except function entry offset (0) fits the criterion,
even if that offset is not at instruction boundary, as the parser
comes before probing. But with "ENDBR64" instruction on x86, offset
4 is treated as function entry. So, X can't be 4 as well. Thus, 8
was used as offset for the test case. On 64-bit powerpc though, any
offset <= 16 can be considered function entry depending on build
configuration (see arch_kprobe_on_func_entry() for implementation
details). So, use `vfs_read+20` to accommodate that scenario too.

Suggested-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Shuah,

Can you take this through your tree?
Yes I can take it. I do have question about whether this is
a fix - sounds like it is from the change log.

Clearly stating that it is a fix will help so it can be picked
up for stables.
I would say it's a fix, as the test currently fails in certain scenarios
for powerpc.

You can add:

Fixes: 4231f30fcc34a ("selftests/ftrace: Add BTF arguments test cases")
I applied this to linux-kselftest fixes - will send it up for rc2 or rc3

thanks,
-- Shuah

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help