The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/4] platform/x86/amd/hsmp: ACPI input hardening and data-plane readiness gating
@ 2026-06-29  7:39 Muralidhara M K
  2026-06-29  7:39 ` [PATCH 1/4] platform/x86/amd/hsmp: Validate ACPI UID before parsing socket index Muralidhara M K
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Muralidhara M K @ 2026-06-29  7:39 UTC (permalink / raw)
  To: ilpo.jarvinen; +Cc: platform-driver-x86, linux-kernel, Muralidhara M K

This series hardens the AMD HSMP ACPI driver against malformed firmware
and fixes a data-plane readiness race on multi-socket systems.  It is
split out and reworked from the larger HSMP concurrency series.

Patches 1-2 validate ACPI input before it is used:

  - hsmp_get_uid() passed the device UID straight to kstrtou16(uid + 2)
    without checking it; a NULL or too-short UID could dereference NULL
    or read past the end of the string.

  - hsmp_read_acpi_dsd() dereferenced elements[0] and elements[1] of each
    mailbox sub-package before confirming the package held two elements,
    allowing an out-of-bounds read on a malformed _DSD.

These two are based on the review discussion at [1].

Patches 3-4 close a startup race on the lock-free data plane.  On a
multi-socket system socket 0 exposes /dev/hsmp before later sockets
finish probing, so a message aimed at a socket still in bring-up could
pass the sock->dev readiness gate and dereference a NULL virt_base_addr:

  - Patch 3 is a pure refactor that threads struct device explicitly
    through the ACPI mailbox parsers so they no longer depend on sock->dev
    being set early.

  - Patch 4 publishes sock->dev last with smp_store_release() once the
    mailbox and semaphore are initialized, and consumes it with
    smp_load_acquire() in hsmp_send_message().

These two are based on the earlier submission at [2].

Each patch was built individually with W=1 (no new warnings) and passes
checkpatch.pl --strict and codespell.

[1] https://lore.kernel.org/platform-driver-x86/b723da76-6309-0cd4-59e0-5931231f585d@linux.intel.com/T/#u
[2] https://lore.kernel.org/platform-driver-x86/20260625123337.886435-5-muralidhara.mk@amd.com/T/#u

Muralidhara M K (4):
  platform/x86/amd/hsmp: Validate ACPI UID before parsing socket index
  platform/x86/amd/hsmp: Validate _DSD mailbox sub-package element count
  platform/x86/amd/hsmp: Pass struct device explicitly to ACPI mailbox
    parsers
  platform/x86/amd/hsmp: Gate the data plane on a fully initialized
    socket

 drivers/platform/x86/amd/hsmp/acpi.c | 53 ++++++++++++++++++++--------
 drivers/platform/x86/amd/hsmp/hsmp.c | 12 +++++++
 2 files changed, 50 insertions(+), 15 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-06-29 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29  7:39 [PATCH 0/4] platform/x86/amd/hsmp: ACPI input hardening and data-plane readiness gating Muralidhara M K
2026-06-29  7:39 ` [PATCH 1/4] platform/x86/amd/hsmp: Validate ACPI UID before parsing socket index Muralidhara M K
2026-06-29  7:39 ` [PATCH 2/4] platform/x86/amd/hsmp: Validate _DSD mailbox sub-package element count Muralidhara M K
2026-06-29  7:39 ` [PATCH 3/4] platform/x86/amd/hsmp: Pass struct device explicitly to ACPI mailbox parsers Muralidhara M K
2026-06-29 12:46   ` Ilpo Järvinen
2026-06-29 14:07     ` M K, Muralidhara
2026-06-29 14:52       ` Ilpo Järvinen
2026-06-29  7:39 ` [PATCH 4/4] platform/x86/amd/hsmp: Gate the data plane on a fully initialized socket Muralidhara M K
2026-06-29 12:50   ` Ilpo Järvinen

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