From: Kris Van Hees Date: Tue, 12 Dec 2017 18:19:21 +0000 (-0500) Subject: dtrace: do not use copy_from_user when accessing kernel stack X-Git-Tag: v4.1.12-124.31.3~1468 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d9d9e275a9a31fbd6f085bbd809d15753137d0a4;p=users%2Fjedix%2Flinux-maple.git 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 --- 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;