All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/16] platform/x86: dell-smbios: Fix call filtering, lifetime and error handling
@ 2026-11-18  4:25 Rosen Penev
  2026-11-18  4:25 ` [PATCH v2 01/16] platform/x86: dell-smbios: Only allow unprivileged reads of whitelisted tokens Rosen Penev
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: Rosen Penev @ 2026-11-18  4:25 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen, Edward O'Callaghan,
	Mario Limonciello, Darren Hart (VMware)
  Cc: platform-driver-x86, Dell.Client.Kernel

Fixes for the dell-smbios dispatcher and its SMM and WMI backends.

Patch 1 is security relevant: /dev/wmi/dell-smbios is mode 0444, and the
WSMT tokens are whitelisted without a capability for both reads and
writes, so any local user can write to the WSMT token location and
change the BIOS setting. Patch 2 closes the related gap where tokens
sharing a location were filtered by whichever came first. Both were
found by code review; I have no WSMT-capable machine to reproduce them on.

Patches 3-11 fix a use-after-free when the dell-smbios.1 device is
unbound, an empty token sysfs group, use of an unpopulated SMI port,
unchecked SMI and registration errors, and a WMI buffer size underflow.

Patches 1-11 carry Fixes: tags and come first so they can be applied
on their own. Patches 12-16 are hardening and cleanups for the next
merge window: they stop unprivileged users from flooding the log,
restrict the token sysfs files by mode, and tidy up the rest.

These patches were developed with the help of an AI coding assistant
(Claude Opus 5.5): it reviewed the drivers, found the issues and drafted
the fixes and changelogs. I reviewed every change and I am responsible
for them.

All patches build cleanly with W=1.

Tested on a Dell Precision M4800 running v7.2.15, using the equivalent
backports built as out-of-tree modules:
 - token sysfs files are 0400; unprivileged reads fail, root reads work
 - unprivileged non-whitelisted token reads through /dev/wmi/dell-smbios
   are rejected, and 503 rejected calls logged 10 lines; root calls work
 - dell-laptop, dell-pc and dell-wmi work on top, and three unload/reload
   cycles of the whole stack are clean
The WSMT write fix (patch 1) could not be exercised: this machine has no
WSMT tokens. Its seven 0xDA structures all report SMI port 0xb2.


Changes in v2:
- Patch 3: don't leak token_entries when kasprintf() or
  sysfs_create_group() fails; fall through to its kfree() and return
  ret from a single exit
- v1: https://lore.kernel.org/platform-driver-x86/cover.1794871007.git.rosenp@gmail.com/

Rosen Penev (16):
  platform/x86: dell-smbios: Only allow unprivileged reads of
    whitelisted tokens
  platform/x86: dell-smbios: Filter every token at the requested
    location
  platform/x86: dell-smbios: Return the real error from
    build_tokens_sysfs()
  platform/x86: dell-smbios: Skip 0xDA structures without tokens
  platform/x86: dell-smbios: Use dev_driver_string() in debug messages
  platform/x86: dell-smbios-smm: Use the first 0xDA structure with an
    SMI port
  platform/x86: dell-smbios-smm: Propagate SMI request errors
  platform/x86: dell-smbios-smm: Clear platform_device when it is
    released
  platform/x86: dell-smbios-wmi: Don't unregister a driver that failed
    to register
  platform/x86: dell-smbios-wmi: Reject buffer sizes too small for a
    call
  platform/x86: dell-smbios: Don't tie dispatcher entries to the device
    driver
  platform/x86: dell-smbios-smm: Set the WSMT test call after clearing
    the buffer
  platform/x86: dell-smbios-wmi: Don't let unprivileged users flood the
    log
  platform/x86: dell-smbios: Suppress bind attributes of the platform
    driver
  platform/x86: dell-smbios: Restrict token sysfs files with their mode
  platform/x86: dell-smbios: Drop smbios_mutex from module exit

 drivers/platform/x86/dell/dell-smbios-base.c | 162 +++++++++++--------
 drivers/platform/x86/dell/dell-smbios-smm.c  |  24 ++-
 drivers/platform/x86/dell/dell-smbios-wmi.c  |  23 ++-
 3 files changed, 136 insertions(+), 73 deletions(-)


base-commit: 2800868f63227c8237d70c41e70d441c919620d6
-- 
2.56.1


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

end of thread, other threads:[~2026-11-18  4:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18  4:25 [PATCH v2 00/16] platform/x86: dell-smbios: Fix call filtering, lifetime and error handling Rosen Penev
2026-11-18  4:25 ` [PATCH v2 01/16] platform/x86: dell-smbios: Only allow unprivileged reads of whitelisted tokens Rosen Penev
2026-11-18  4:25 ` [PATCH v2 02/16] platform/x86: dell-smbios: Filter every token at the requested location Rosen Penev
2026-11-18  4:25 ` [PATCH v2 03/16] platform/x86: dell-smbios: Return the real error from build_tokens_sysfs() Rosen Penev
2026-11-18  4:25 ` [PATCH v2 04/16] platform/x86: dell-smbios: Skip 0xDA structures without tokens Rosen Penev
2026-11-18  4:25 ` [PATCH v2 05/16] platform/x86: dell-smbios: Use dev_driver_string() in debug messages Rosen Penev
2026-11-18  4:25 ` [PATCH v2 06/16] platform/x86: dell-smbios-smm: Use the first 0xDA structure with an SMI port Rosen Penev
2026-11-18  4:25 ` [PATCH v2 07/16] platform/x86: dell-smbios-smm: Propagate SMI request errors Rosen Penev
2026-11-18  4:25 ` [PATCH v2 08/16] platform/x86: dell-smbios-smm: Clear platform_device when it is released Rosen Penev
2026-11-18  4:25 ` [PATCH v2 09/16] platform/x86: dell-smbios-wmi: Don't unregister a driver that failed to register Rosen Penev
2026-11-18  4:25 ` [PATCH v2 10/16] platform/x86: dell-smbios-wmi: Reject buffer sizes too small for a call Rosen Penev
2026-11-18  4:25 ` [PATCH v2 11/16] platform/x86: dell-smbios: Don't tie dispatcher entries to the device driver Rosen Penev
2026-11-18  4:25 ` [PATCH v2 12/16] platform/x86: dell-smbios-smm: Set the WSMT test call after clearing the buffer Rosen Penev
2026-11-18  4:25 ` [PATCH v2 13/16] platform/x86: dell-smbios-wmi: Don't let unprivileged users flood the log Rosen Penev
2026-11-18  4:25 ` [PATCH v2 14/16] platform/x86: dell-smbios: Suppress bind attributes of the platform driver Rosen Penev
2026-11-18  4:25 ` [PATCH v2 15/16] platform/x86: dell-smbios: Restrict token sysfs files with their mode Rosen Penev
2026-11-18  4:25 ` [PATCH v2 16/16] platform/x86: dell-smbios: Drop smbios_mutex from module exit Rosen Penev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.