From: Alexandre Chartre <alexandre.chartre@oracle.com>
To: Bo YU <tsu.yubo@gmail.com>,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
hpa@zytor.com, peterz@infradead.org, luto@kernel.org,
jannh@google.com, dave.hansen@linux.intel.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] arch/x86: Return value from notify_die should to be checked.
Date: Mon, 22 Jun 2020 10:52:23 +0200 [thread overview]
Message-ID: <4d1ef78e-f001-a685-9a69-afa68454fdc7@oracle.com> (raw)
In-Reply-To: <20200621102634.n43ozcsiravdi2ie@debian.debian-2>
On 6/21/20 12:26 PM, Bo YU wrote:
> This is detected by Coverity scan: #CID: 1464472(CHECKED_RETURN)
>
> FIXES: c94082656dac7(x86: Use enum instead of literals for trap values)
> Signed-off-by: Bo YU <tsu.yubo@gmail.com>
> ---
> arch/x86/kernel/traps.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
> index af75109485c2..bf014fb59017 100644
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -401,7 +401,8 @@ DEFINE_IDTENTRY_DF(exc_double_fault)
>
> nmi_enter();
> instrumentation_begin();
> - notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
> + if (notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV))
> + return;
>
This change is not correct, if there's a double fault then we should die even if
notify_die() fails. So the appropriate change to make Coverity happy is probably:
(void) notify_die(DIE_TRAP, str, regs, error_code, X86_TRAP_DF, SIGSEGV);
alex.
next prev parent reply other threads:[~2020-06-22 8:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-21 10:26 Bo YU
2020-06-22 8:52 ` Alexandre Chartre [this message]
2020-06-22 9:17 ` Boris Petkov
2020-06-22 9:46 ` Peter Zijlstra
2020-06-22 11:56 ` Bo YU
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=4d1ef78e-f001-a685-9a69-afa68454fdc7@oracle.com \
--to=alexandre.chartre@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=tsu.yubo@gmail.com \
/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®