Linux EDAC development
 help / color / mirror / Atom feed
* [bug report] x86/mce: Prevent severity computation from being instrumented
@ 2021-12-17 10:20 Dan Carpenter
  2021-12-17 11:29 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-12-17 10:20 UTC (permalink / raw)
  To: bp; +Cc: linux-edac

Hello Borislav Petkov,

This is a semi-automatic email about new static checker warnings.

The patch 0a5b288e85bb: "x86/mce: Prevent severity computation from
being instrumented" from Oct 13, 2021, leads to the following Smatch
complaint:

    arch/x86/kernel/cpu/mce/severity.c:286 error_context()
    warn: variable dereferenced before check 'regs' (see line 280)

arch/x86/kernel/cpu/mce/severity.c
   279		fixup_type = ex_get_fixup_type(m->ip);
   280		copy_user  = is_copy_from_user(regs);
                                               ^^^^
New unchecked dereference

   281		instrumentation_end();
   282	
   283		switch (fixup_type) {
   284		case EX_TYPE_UACCESS:
   285		case EX_TYPE_COPY:
   286			if (!regs || !copy_user)
                             ^^^^
Old code checked for NULL

   287				return IN_KERNEL;
   288			m->kflags |= MCE_IN_KERNEL_COPYIN;

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-17 23:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-17 10:20 [bug report] x86/mce: Prevent severity computation from being instrumented Dan Carpenter
2021-12-17 11:29 ` Borislav Petkov
2021-12-17 17:13   ` Luck, Tony
2021-12-17 23:50     ` [PATCH] x86/mce: Check regs before accessing it Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox