All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] objtool/klp: Reject changed functions without an ftrace call site
@ 2026-10-22 12:25 Puranjay Mohan
  2026-10-22 12:25 ` [PATCH 1/3] objtool/klp: Build test fixtures with ftrace Puranjay Mohan
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Puranjay Mohan @ 2026-10-22 12:25 UTC (permalink / raw)
  To: live-patching
  Cc: Puranjay Mohan, Josh Poimboeuf, Peter Zijlstra, Song Liu,
	Miroslav Benes, Joe Lawrence

A changed function without an ftrace call site makes klp-build produce a
patch module which fails to load.  The kernel's 'inline' implies notrace,
so this happens whenever the compiler emits an inline function out of
line.  Patch 2 makes klp diff reject such functions, patch 3 tests it.
Patch 1 builds the test fixtures with ftrace, which patch 2 needs.

Tested on x86_64 with GCC 11 and Clang 22: the objtool klp tests, and
klp-build with a vng boot, where a patch module built without the check
fails to load with "failed to find location for function".

Note for the arm64 klp-build series: arm64 has no __mcount_loc, so on
top of that series this would reject every changed function.  It needs
mark_traceable_functions() to also handle __patchable_function_entries,
using pfe_offset.  I can send that on top of the arm64 series.

Puranjay Mohan (3):
  objtool/klp: Build test fixtures with ftrace
  objtool/klp: Reject changed functions without an ftrace call site
  objtool/klp: Add test for changed functions without an ftrace call
    site

 .../objtool/Documentation/klp-write-tests.txt |  9 ++-
 tools/objtool/include/objtool/elf.h           |  1 +
 tools/objtool/klp-diff.c                      | 47 ++++++++++++
 .../tests/generic/test-thinlto-ambiguity.sh   |  3 +-
 .../tests/generic/test-thinlto-local.sh       |  5 +-
 tools/objtool/tests/lib.sh                    | 42 ++++++++++-
 .../tests/x86/fixtures/notrace_target.c       | 71 ++++++++++++++++++
 tools/objtool/tests/x86/test-checksum-alt.sh  |  4 -
 .../objtool/tests/x86/test-notrace-target.sh  | 74 +++++++++++++++++++
 .../tests/x86/test-special-sections.sh        | 23 +++---
 10 files changed, 257 insertions(+), 22 deletions(-)
 create mode 100644 tools/objtool/tests/x86/fixtures/notrace_target.c
 create mode 100755 tools/objtool/tests/x86/test-notrace-target.sh


base-commit: 6ecc854643e6fd6a2d07bc8d83015c7c34a951eb
-- 
2.53.0-Meta


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-22 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 12:25 [PATCH 0/3] objtool/klp: Reject changed functions without an ftrace call site Puranjay Mohan
2026-10-22 12:25 ` [PATCH 1/3] objtool/klp: Build test fixtures with ftrace Puranjay Mohan
2026-10-22 14:46   ` Joe Lawrence
2026-10-22 16:43     ` Puranjay Mohan
2026-10-22 12:25 ` [PATCH 2/3] objtool/klp: Reject changed functions without an ftrace call site Puranjay Mohan
2026-10-22 15:55   ` Joe Lawrence
2026-10-22 12:25 ` [PATCH 3/3] objtool/klp: Add test for " Puranjay Mohan
2026-10-22 16:02   ` Joe Lawrence

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.