lkml.org 
[lkml]   [2020]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -next] arch/x86: Return value from notify_die should to be checked.
From
Date

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.

\
 
 \ /
  Last update: 2020-06-22 10:53    [W:0.061 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site