From: Rosen Penev <rosenp@gmail.com>
To: "Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Edward O'Callaghan" <quasisec@google.com>,
"Mario Limonciello" <mario.limonciello@dell.com>,
"Darren Hart (VMware)" <dvhart@infradead.org>
Cc: platform-driver-x86@vger.kernel.org, Dell.Client.Kernel@dell.com
Subject: [PATCH v2 00/16] platform/x86: dell-smbios: Fix call filtering, lifetime and error handling
Date: Tue, 17 Nov 2026 20:25:22 -0800 [thread overview]
Message-ID: <cover.1794975827.git.rosenp@gmail.com> (raw)
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
next reply other threads:[~2026-11-18 4:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 4:25 Rosen Penev [this message]
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
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=cover.1794975827.git.rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=dvhart@infradead.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=mario.limonciello@dell.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=quasisec@google.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 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.