]> git.baikalelectronics.ru Git - kernel.git/commit
static_call: Fix the module key fixup
authorPeter Zijlstra <peterz@infradead.org>
Thu, 25 Feb 2021 22:03:51 +0000 (23:03 +0100)
committerIngo Molnar <mingo@kernel.org>
Sat, 6 Mar 2021 11:49:08 +0000 (12:49 +0100)
commitd5e0bbfa891725b9ce04ebd14d30f026091c2be4
treedd509e6667c8d7f66d806e3c11b8551b85c5376c
parent219c9076286fd92026e818ab1375558e5b20649f
static_call: Fix the module key fixup

Provided the target address of a R_X86_64_PC32 relocation is aligned,
the low two bits should be invariant between the relative and absolute
value.

Turns out the address is not aligned and things go sideways, ensure we
transfer the bits in the absolute form when fixing up the key address.

Fixes: 035a97a0154f ("static_call: Allow module use without exposing static_call_key")
Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lkml.kernel.org/r/20210225220351.GE4746@worktop.programming.kicks-ass.net
kernel/static_call.c