mirror of
https://github.com/dynup/kpatch
synced 2024-12-12 16:34:40 +00:00
0537ff6a6f
It's possible for a static local variable's data section to have a relocation which refers to the variable symbol itself. Fix the logic which searches for the user of a static local variable by only looking in text sections (i.e. functions). Fixes #411.
21 lines
404 B
Diff
21 lines
404 B
Diff
Index: src/kernel/reboot.c
|
|
===================================================================
|
|
--- src.orig/kernel/reboot.c
|
|
+++ src/kernel/reboot.c
|
|
@@ -285,8 +285,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int
|
|
return ret;
|
|
}
|
|
|
|
+void kpatch_foo(void)
|
|
+{
|
|
+ if (!jiffies)
|
|
+ printk("kpatch_foo\n");
|
|
+}
|
|
+
|
|
static void deferred_cad(struct work_struct *dummy)
|
|
{
|
|
+ kpatch_foo();
|
|
kernel_restart(NULL);
|
|
}
|
|
|