From d9d9e275a9a31fbd6f085bbd809d15753137d0a4 Mon Sep 17 00:00:00 2001 From: Kris Van Hees Date: Tue, 12 Dec 2017 13:19:21 -0500 Subject: [PATCH] dtrace: do not use copy_from_user when accessing kernel stack The implementation of sdt_getarg() for x86_64 uses a copy_from_user variant while reading from kernel stack which is obviously wrong. This commit corrects that. Orabug: 25949088 Signed-off-by: Kris Van Hees Reviewed-by: Tomas Jedlicka --- arch/x86/dtrace/sdt_x86_64.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/dtrace/sdt_x86_64.c b/arch/x86/dtrace/sdt_x86_64.c index edfc30f29574..40f18d488e34 100644 --- a/arch/x86/dtrace/sdt_x86_64.c +++ b/arch/x86/dtrace/sdt_x86_64.c @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -105,8 +104,7 @@ uint64_t sdt_getarg(void *arg, dtrace_id_t id, void *parg, int argno, st = (uint64_t *)regs->sp; DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - __copy_from_user_inatomic_nocache(&val, (void *)&st[argno - 6], - sizeof(st[0])); + val = st[argno - 6]; DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); return val; -- 2.50.1