diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-15 19:28:09 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-02-16 01:26:26 +0300 |
commit | c8e3dd86600a1a7b165478cc626d69bf07967c15 (patch) | |
tree | 78340dbc13eea3b70f43b1a0c9f4df3bc238db1e /arch/x86/kernel/stacktrace.c | |
parent | bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff) | |
download | linux-c8e3dd86600a1a7b165478cc626d69bf07967c15.tar.xz |
x86 user stack frame reads: switch to explicit __get_user()
rather than relying upon the magic in raw_copy_from_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/x86/kernel/stacktrace.c')
-rw-r--r-- | arch/x86/kernel/stacktrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 2d6898c2cb64..6ad43fc44556 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c @@ -96,7 +96,8 @@ struct stack_frame_user { }; static int -copy_stack_frame(const void __user *fp, struct stack_frame_user *frame) +copy_stack_frame(const struct stack_frame_user __user *fp, + struct stack_frame_user *frame) { int ret; @@ -105,7 +106,8 @@ copy_stack_frame(const void __user *fp, struct stack_frame_user *frame) ret = 1; pagefault_disable(); - if (__copy_from_user_inatomic(frame, fp, sizeof(*frame))) + if (__get_user(frame->next_fp, &fp->next_fp) || + __get_user(frame->ret_addr, &fp->ret_addr)) ret = 0; pagefault_enable(); |