From 495948242e84f9e1595bfe45ef042b7649cf9331 Mon Sep 17 00:00:00 2001 From: Li Bin Date: Mon, 12 Oct 2015 17:11:48 +0800 Subject: [PATCH] kpatch-build: fix shadow_get function The shadow_get function does't consider the case that 'shadow is inpace', and after the shadow->data be set to the data, it will not be the pointer. This patch fix it. Signed-off-by: Li Bin --- kmod/core/shadow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kmod/core/shadow.c b/kmod/core/shadow.c index a248ac7..5b973c4 100644 --- a/kmod/core/shadow.c +++ b/kmod/core/shadow.c @@ -158,6 +158,9 @@ void *kpatch_shadow_get(void *obj, char *var) (unsigned long)obj) { if (shadow->obj == obj && !strcmp(shadow_var(shadow), var)) { rcu_read_unlock(); + if (shadow_is_inplace(shadow)) + return &(shadow->data); + return shadow->data; } }