Re: kernel NULL pointer dereference in quirk_clear_strap_no_soft_reset_dev2_f0 -> amd_smn_read

Borislav Petkov <[email protected]>
Newsgroups dev.linux.lists.regressions,org.kernel.vger.linux-kernel
Message-ID <20260606015907.GCaiN-6_XN_kSXwnHV@fat_crate.local>
On Sat, Jun 06, 2026 at 01:37:03AM +0200, Marek Marczykowski-Górecki wrote:
> Is it actually guaranteed to run before PCI fixups? They are done via
> fs_initcall_sync.

Yap, the sync initcalls run after the respective level initcalls.

> IMO it would be safer to guard __amd_smn_rw() with something that would also
> detect calls before amd_smn_init() is called.  Like using smn_exclusive in
> the Penny's patch, or amd_roots in the Mario's patch.

I can do this if absolutely necessary:

static bool amd_node_off = true;

and then set it accordingly in the init function but I don't think that's
needed.

> That said, amd_smn_read() called before amd_smn_init() would (should?)
> fail anyway, even in non-virtualized case. So, maybe this approach
> (still crash on NULL ptr when called before amd_smn_init()) is
> acceptable?

Right, then we can hear about it and see who's doing what shenanigans.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.