x86/livepatch: Validate __fentry__ location
authorPeter Zijlstra <peterz@infradead.org>
Tue, 8 Mar 2022 15:30:30 +0000 (16:30 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 15 Mar 2022 09:32:37 +0000 (10:32 +0100)
commitd15cb3dab1e4f00e29599a4f5e1f6678a530d270
tree0a1cdf9129615771da2f0f2cabc00274b60e2ce4
parentaebfd12521d9c7d0b502cf6d06314cfbcdccfe3b
x86/livepatch: Validate __fentry__ location

Currently livepatch assumes __fentry__ lives at func+0, which is most
likely untrue with IBT on. Instead make it use ftrace_location() by
default which both validates and finds the actual ip if there is any
in the same symbol.

Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220308154318.285971256@infradead.org
arch/powerpc/include/asm/livepatch.h
kernel/livepatch/patch.c