From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
Yazen Ghannam <yazen.ghannam@amd.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>,
"open list:AMD NODE DRIVER" <linux-kernel@vger.kernel.org>,
regressions@lists.linux.dev
Subject: Re: kernel NULL pointer dereference in quirk_clear_strap_no_soft_reset_dev2_f0 -> amd_smn_read
Date: Sat, 6 Jun 2026 00:40:20 +0200 [thread overview]
Message-ID: <aiNQVHXAvdVhZrZn@mail-itl> (raw)
In-Reply-To: <20260605222648.GAaiNNKAr3mtWsMr7e@fat_crate.local>
[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]
On Fri, Jun 05, 2026 at 03:26:48PM -0700, Borislav Petkov wrote:
> On Fri, Jun 05, 2026 at 11:55:47PM +0200, Marek Marczykowski-Górecki wrote:
> > Well, it clearly happens, see the call trace in the first message of the
> > thread...
> > Do you suggest the fix should change
> > quirk_clear_strap_no_soft_reset_dev2_f0()?
>
> https://lore.kernel.org/all/20260602184823.GKah8ld2QJLm28xoa9@fat_crate.local/
>
> That thing should return an error so that amd_smn_read() is not even available
> on guests.
What do you mean by "not even available on guests"? I'm talking about
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/pci/fixup.c#n876
static void quirk_clear_strap_no_soft_reset_dev2_f0(struct pci_dev *dev)
{
u32 data;
if (!amd_smn_read(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, &data)) {
data &= ~AMD_15B8_RCC_DEV2_EPF0_STRAP2_NO_SOFT_RESET_DEV2_F0_MASK;
if (amd_smn_write(0, AMD_15B8_RCC_DEV2_EPF0_STRAP2, data))
pci_err(dev, "Failed to write data 0x%x\n", data);
} else {
pci_err(dev, "Failed to read data\n");
}
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x15b8, quirk_clear_strap_no_soft_reset_dev2_f0);
There is nothing here that would prevent amd_smn_read() being called
inside a guest...
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-06-05 22:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 1:01 Marek Marczykowski-Górecki
2026-01-13 2:47 ` Mario Limonciello
2026-01-13 16:04 ` Borislav Petkov
2026-06-05 17:34 ` Marek Marczykowski-Górecki
2026-06-05 17:36 ` Mario Limonciello
2026-06-05 17:45 ` Marek Marczykowski-Górecki
2026-06-05 18:54 ` Mario Limonciello
2026-06-05 20:23 ` Marek Marczykowski-Górecki
2026-06-05 21:15 ` Borislav Petkov
2026-06-05 21:55 ` Marek Marczykowski-Górecki
2026-06-05 22:26 ` Borislav Petkov
2026-06-05 22:40 ` Marek Marczykowski-Górecki [this message]
2026-06-05 23:09 ` Borislav Petkov
2026-06-05 23:37 ` Marek Marczykowski-Górecki
2026-06-06 1:59 ` Borislav Petkov
2026-01-30 17:01 ` Yazen Ghannam
2026-02-07 1:57 ` Marek Marczykowski-Górecki
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=aiNQVHXAvdVhZrZn@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=regressions@lists.linux.dev \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.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®