mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Cc: dougthompson@xmission.com, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] EDAC, MCE, AMD: Fix code to prevent NULL dereference
Date: Tue, 18 Feb 2014 01:36:54 +0100	[thread overview]
Message-ID: <20140218003654.GK4559@pd.tnic> (raw)
In-Reply-To: <53028EE8.20106@amd.com>

On Mon, Feb 17, 2014 at 04:36:24PM -0600, Aravind Gopalakrishnan wrote:
> snapshot of the oops from simulating on my system:
> [   28.846200] [Hardware Error]: MC0 Error:
> [   28.846218] BUG: unable to handle kernel NULL pointer dereference
> at           (null)
> [   28.846232] IP: [<ffffffff81608526>] amd_decode_mce+0x526/0x900

Ok, I see it now.

mce_amd_inj.c calls directly amd_decode_mce() which is wrong. What it
should do, instead, is what mce_log does:

	ret = atomic_notifier_call_chain(&x86_mce_decoder_chain, 0, mce);
	...


and send the mce struct through the notifier chain so that if we haven't
registered on it, we don't decode the error.

> Shall I work up the patch with both sets of changes and resend?

Just replace the amd_decode_mce() call in mce_amd_inj.c with the above
call to the notifier and it should work, AFAICT. We should still add the
hunk I sent you earlier to take care of the module case. Oh, and make
amd_decode_mce() static so that nothing outside of mce_amd.c uses it.

I might be missing something but it is too late now and I'm going to bed
- more fun tomorrow :-)

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  reply	other threads:[~2014-02-18  0:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 17:49 Aravind Gopalakrishnan
2014-02-17 18:27 ` Borislav Petkov
2014-02-17 19:26   ` Aravind Gopalakrishnan
2014-02-17 19:41     ` Borislav Petkov
2014-02-17 22:36       ` Aravind Gopalakrishnan
2014-02-18  0:36         ` Borislav Petkov [this message]
2014-02-18  8:46           ` Borislav Petkov
2014-02-18 18:27             ` Aravind Gopalakrishnan
2014-02-20  9:32               ` Borislav Petkov
2014-02-20 16:07                 ` Aravind Gopalakrishnan
2014-02-20 16:13                   ` Borislav Petkov
2014-02-21 14:23                     ` Borislav Petkov
2014-02-21 16:46                       ` Aravind Gopalakrishnan

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=20140218003654.GK4559@pd.tnic \
    --to=bp@alien8.de \
    --cc=aravind.gopalakrishnan@amd.com \
    --cc=dougthompson@xmission.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.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

Powered by JetHome