lkml.org 
[lkml]   [2020]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] x86/dumpstack: Fix misleading instruction pointer error message
On Mon, Nov 16, 2020 at 2:01 PM Thomas Gleixner <tglx@linutronix.de> wrote:
> arch/x86/kernel/dumpstack.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
>
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -78,6 +78,9 @@ static int copy_code(struct pt_regs *reg
> if (!user_mode(regs))
> return copy_from_kernel_nofault(buf, (u8 *)src, nbytes);
>
> + /* The user space code from other tasks cannot be accessed. */
> + if (regs != task_pt_regs(current))
> + return -EPERM;

Depending on exactly where this gets called, this may not be
sufficient. You should also check nmi_uaccess_okay().

--Andy

\
 
 \ /
  Last update: 2020-11-17 00:05    [W:0.329 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site