Skip to content

Commit 38e0e4d

Browse files
author
Peter Zijlstra
committed
x86/ibt, objtool: Don't discard text references from tracepoint section
On Tue, Jun 28, 2022 at 04:28:58PM +0800, Pengfei Xu wrote: > # ./ftracetest > === Ftrace unit tests === > [1] Basic trace file check [PASS] > [2] Basic test for tracers [PASS] > [3] Basic trace clock test [PASS] > [4] Basic event tracing check [PASS] > [5] Change the ringbuffer size [PASS] > [6] Snapshot and tracing setting [PASS] > [7] trace_pipe and trace_marker [PASS] > [8] Test ftrace direct functions against tracers [UNRESOLVED] > [9] Test ftrace direct functions against kprobes [UNRESOLVED] > [10] Generic dynamic event - add/remove eprobe events [FAIL] > [11] Generic dynamic event - add/remove kprobe events > > It 100% reproduced in step 11 and then missing ENDBR BUG generated: > " > [ 9332.752836] mmiotrace: enabled CPU7. > [ 9332.788612] mmiotrace: disabled. > [ 9337.103426] traps: Missing ENDBR: syscall_regfunc+0x0/0xb0 It turns out that while syscall_regfunc() does have an ENDBR when generated, it gets sealed by objtool's .ibt_endbr_seal list. Since the only text references to this function: $ git grep syscall_regfunc include/linux/tracepoint.h:extern int syscall_regfunc(void); include/trace/events/syscalls.h: syscall_regfunc, syscall_unregfunc include/trace/events/syscalls.h: syscall_regfunc, syscall_unregfunc kernel/tracepoint.c:int syscall_regfunc(void) appear in the __tracepoint section which is excluded by objtool. Fixes: 3c6f9f7 ("objtool: Rework ibt and extricate from stack validation") Reported-by: Pengfei Xu <pengfei.xu@intel.com Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/Yrrepdaow4F5kqG0@hirez.programming.kicks-ass.net
1 parent b57feed commit 38e0e4d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3826,8 +3826,7 @@ static int validate_ibt(struct objtool_file *file)
38263826
!strcmp(sec->name, "__bug_table") ||
38273827
!strcmp(sec->name, "__ex_table") ||
38283828
!strcmp(sec->name, "__jump_table") ||
3829-
!strcmp(sec->name, "__mcount_loc") ||
3830-
!strcmp(sec->name, "__tracepoints"))
3829+
!strcmp(sec->name, "__mcount_loc"))
38313830
continue;
38323831

38333832
list_for_each_entry(reloc, &sec->reloc->reloc_list, list)

0 commit comments

Comments
 (0)