lkml.org 
[lkml]   [2019]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3/4] x86/dumpstack: Introduce die_addr() for die() with #GP fault address
On Thu, Dec 19, 2019 at 12:11:49AM +0100, Jann Horn wrote:
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index c8b4ae6aed5b..4c691bb9e0d9 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -621,7 +621,10 @@ do_general_protection(struct pt_regs *regs, long error_code)
> "maybe for address",
> gp_addr);


> - die(desc, regs, error_code);

I've added here:

/*
* KASAN is interested only in the non-canonical case, clear it
* otherwise.
*/

> + if (hint != GP_NON_CANONICAL)
> + gp_addr = 0;


otherwise you have:

if (hint != GP_NO_HINT)
...

if (hint != GP_NON_CANONICAL)
...

which is kinda confusing at a first glance and one has to follow the
code into die_addr() to figure out the usage of the address argument.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2019-12-31 13:14    [W:0.074 / U:9.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site