From: Borislav Petkov <bp@alien8.de>
To: Jann Horn <jannh@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, Andrey Ryabinin <aryabinin@virtuozzo.com>,
Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
Andrey Konovalov <andreyknvl@google.com>,
Andy Lutomirski <luto@kernel.org>,
Sean Christopherson <sean.j.christopherson@intel.com>
Subject: Re: [PATCH v7 3/4] x86/dumpstack: Introduce die_addr() for die() with #GP fault address
Date: Tue, 31 Dec 2019 13:11:21 +0100 [thread overview]
Message-ID: <20191231121121.GA13549@zn.tnic> (raw)
In-Reply-To: <20191218231150.12139-3-jannh@google.com>
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
next prev parent reply other threads:[~2019-12-31 12:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-18 23:11 [PATCH v7 1/4] x86/insn-eval: Add support for 64-bit kernel mode Jann Horn
2019-12-18 23:11 ` [PATCH v7 2/4] x86/traps: Print address on #GP Jann Horn
2020-01-01 10:07 ` [tip: x86/core] " tip-bot2 for Jann Horn
2019-12-18 23:11 ` [PATCH v7 3/4] x86/dumpstack: Introduce die_addr() for die() with #GP fault address Jann Horn
2019-12-31 12:11 ` Borislav Petkov [this message]
2019-12-31 16:31 ` [PATCH] x86/traps: Cleanup do_general_protection() Borislav Petkov
2020-01-01 10:07 ` [tip: x86/core] x86/dumpstack: Introduce die_addr() for die() with #GP fault address tip-bot2 for Jann Horn
2019-12-18 23:11 ` [PATCH v7 4/4] x86/kasan: Print original address on #GP Jann Horn
2019-12-19 10:21 ` Dmitry Vyukov
2020-01-01 10:07 ` [tip: x86/core] " tip-bot2 for Jann Horn
2020-01-01 10:07 ` [tip: x86/core] x86/insn-eval: Add support for 64-bit kernel mode tip-bot2 for Jann Horn
2020-01-02 7:47 ` [PATCH v7 1/4] " Kirill A. Shutemov
2020-01-02 7:55 ` Andy Lutomirski
2020-01-02 9:27 ` Borislav Petkov
2020-01-02 9:49 ` Kirill A. Shutemov
2020-01-02 10:01 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191231121121.GA13549@zn.tnic \
--to=bp@alien8.de \
--cc=andreyknvl@google.com \
--cc=aryabinin@virtuozzo.com \
--cc=dvyukov@google.com \
--cc=glider@google.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®