diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2022-02-15 13:41:06 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-02-16 23:25:12 +1100 |
commit | b64913394f123e819bffabc79a0e48f98e78dc5d (patch) | |
tree | 6bdf27b3d9814cf55f96d62d92731d04857aad60 /kernel/extable.c | |
parent | 69b420ed8fd3917ac7073256b4929aa246b6fe31 (diff) | |
download | linux-b64913394f123e819bffabc79a0e48f98e78dc5d.tar.gz linux-b64913394f123e819bffabc79a0e48f98e78dc5d.tar.bz2 linux-b64913394f123e819bffabc79a0e48f98e78dc5d.zip |
lkdtm: Really write into kernel text in WRITE_KERN
WRITE_KERN is supposed to overwrite some kernel text, namely
do_overwritten() function.
But at the time being it overwrites do_overwritten() function
descriptor, not function text.
Fix it by dereferencing the function descriptor to obtain
function text pointer. Export dereference_function_descriptor()
for when LKDTM is built as a module.
And make do_overwritten() noinline so that it is really
do_overwritten() which is called by lkdtm_WRITE_KERN().
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/31e58eaffb5bc51c07d8d4891d1982100ade8cfc.1644928018.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'kernel/extable.c')
-rw-r--r-- | kernel/extable.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index 394c39b86e38..bda5e9761541 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -149,6 +149,7 @@ void *dereference_function_descriptor(void *ptr) ptr = p; return ptr; } +EXPORT_SYMBOL_GPL(dereference_function_descriptor); void *dereference_kernel_function_descriptor(void *ptr) { |