]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dtrace: do not use copy_from_user when accessing kernel stack
authorKris Van Hees <kris.van.hees@oracle.com>
Tue, 12 Dec 2017 18:19:21 +0000 (13:19 -0500)
committerKris Van Hees <kris.van.hees@oracle.com>
Fri, 15 Dec 2017 05:28:13 +0000 (00:28 -0500)
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 <kris.van.hees@oracle.com>
Reviewed-by: Tomas Jedlicka <tomas.jedlicka@oracle.com>
arch/x86/dtrace/sdt_x86_64.c

index edfc30f29574f9205fd7038cac3520af24ddc8eb..40f18d488e34cbac1dd6a779c262f4f25cdc5c2f 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <linux/sdt.h>
 #include <linux/slab.h>
-#include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <asm/dtrace_util.h>
 
@@ -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;