lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxgT5WombFuUofEX@nazgul.tnic>
Date:   Wed, 7 Sep 2022 05:45:53 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Jiri Slaby <jslaby@...e.cz>
Cc:     bp@...e.de, tglx@...utronix.de, x86@...nel.org,
        linux-kernel@...r.kernel.org,
        Mark Mossberg <mark.mossberg@...il.com>
Subject: Re: [PATCH] x86/dumpstack: Don't mention RIP in "Code:"

On Tue, Sep 06, 2022 at 09:11:23AM +0200, Jiri Slaby wrote:
> Commit 238c91115cd0 ("x86/dumpstack: Fix misleading instruction pointer
> error message") changed the "Code:" line in bug reports when RIP is an
> invalid pointer. In particular, the report currently says (for example):
> 
>   BUG: kernel NULL pointer dereference, address: 0000000000000000
>   ...
>   RIP: 0010:0x0
>   Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6.
> 
> That "Unable to access opcode bytes at RIP 0xffffffffffffffd6." is
> quite confusing as RIP value is 0, not -42. That -42 comes from
> "regs->ip - PROLOGUE_SIZE", because Code is dumped with some prologue
> (and epilogue).
> 
> So do not mention "RIP" on this line in this context.
> 
> Cc: Mark Mossberg <mark.mossberg@...il.com>
> Cc: Borislav Petkov <bp@...e.de>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> ---
>  arch/x86/kernel/dumpstack.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index afae4dd77495..b3dba35f466e 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -128,7 +128,7 @@ void show_opcodes(struct pt_regs *regs, const char *loglvl)
>  		/* No access to the user space stack of other tasks. Ignore. */
>  		break;
>  	default:
> -		printk("%sCode: Unable to access opcode bytes at RIP 0x%lx.\n",
> +		printk("%sCode: Unable to access opcode bytes at 0x%lx.\n",
>  		       loglvl, prologue);
>  		break;
>  	}

I guess... and it says "opcode bytes" to denote that it is trying to
access instructions so yeah, that RIP might be superfluous.

Acked-by: Borislav Petkov <bp@...e.de>

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ