* [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes
2026-08-17 21:54 [PATCH v13 RESEND 0/5] coreboot CFR firmware attributes Sean Rhodes
@ 2026-08-17 21:54 ` Sean Rhodes
0 siblings, 0 replies; 4+ messages in thread
From: Sean Rhodes @ 2026-08-17 21:54 UTC (permalink / raw)
To: chrome-platform
Cc: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Ilpo Järvinen, Prasanth Ksr, Jorge Lopez, Mark Pearson,
Derek J. Clark, Joshua Grisham, platform-driver-x86,
Dell.Client.Kernel, Sean Rhodes, Michael S. Tsirkin, Chen-Yu Tsai,
Huacai Chen, Tzung-Bi Shih, Brian Norris, Julius Werner,
Thomas Zimmermann, Javier Martinez Canillas, Maarten Lankhorst,
Maxime Ripard, David Airlie, Simona Vetter, Florian Fainelli,
Takashi Sakamoto, Bjorn Helgaas,
Uwe Kleine-König (The Capable Hub),
Titouan Ameline de Cadeville, Kees Cook, Danilo Krummrich,
dri-devel, Krzysztof Kozlowski, Bjorn Andersson, Dmitry Baryshkov,
Geert Uytterhoeven, Arnd Bergmann, Eric Biggers, Luca Weiss,
Michal Simek, Sven Peter, linux-kernel, oliver
Move firmware_attributes_class.h into the main include block and sort the
affected includes. This lets the header move replace each include in place.
Suggested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
---
drivers/platform/x86/asus-armoury.c | 2 +-
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c | 9 +++++----
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 9 +++++----
drivers/platform/x86/lenovo/think-lmi.c | 5 +++--
drivers/platform/x86/lenovo/wmi-other.c | 2 +-
drivers/platform/x86/samsung-galaxybook.c | 3 ++-
6 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index 495dc1e31d40..f3d8c5a85762 100644
--- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c
@@ -20,6 +20,7 @@
#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/errno.h>
+#include "firmware_attributes_class.h"
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/kmod.h>
@@ -34,7 +35,6 @@
#include <linux/sysfs.h>
#include "asus-armoury.h"
-#include "firmware_attributes_class.h"
#define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
index ab46a023cc34..4ff9003c6589 100644
--- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
@@ -8,18 +8,19 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/align.h>
-#include <linux/fs.h>
#include <linux/dmi.h>
-#include <linux/module.h>
+#include "../../firmware_attributes_class.h"
+#include <linux/fs.h>
#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/nls.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/wmi.h>
+
#include "dell-wmi-sysman.h"
-#include "../../firmware_attributes_class.h"
#define MAX_TYPES 4
-#include <linux/nls.h>
struct wmi_sysman_priv wmi_priv = {
.mutex = __MUTEX_INITIALIZER(wmi_priv.mutex),
diff --git a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
index 27fd6cd21529..1965a329be48 100644
--- a/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
+++ b/drivers/platform/x86/hp/hp-bioscfg/bioscfg.c
@@ -7,16 +7,17 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+#include <linux/errno.h>
+#include "../../firmware_attributes_class.h"
#include <linux/fs.h>
-#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/nls.h>
#include <linux/printk.h>
#include <linux/string.h>
#include <linux/wmi.h>
+
#include "bioscfg.h"
-#include "../../firmware_attributes_class.h"
-#include <linux/nls.h>
-#include <linux/errno.h>
MODULE_AUTHOR("Jorge Lopez <jorge.lopez2@hp.com>");
MODULE_DESCRIPTION("HP BIOS Configuration Driver");
diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index e215e86e3db7..9e4b3e973de9 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -13,14 +13,15 @@
#include <linux/acpi.h>
#include <linux/array_size.h>
+#include <linux/dmi.h>
#include <linux/errno.h>
+#include "../firmware_attributes_class.h"
#include <linux/fs.h>
#include <linux/mutex.h>
#include <linux/string_helpers.h>
#include <linux/types.h>
-#include <linux/dmi.h>
#include <linux/wmi.h>
-#include "../firmware_attributes_class.h"
+
#include "think-lmi.h"
static bool debug_support;
diff --git a/drivers/platform/x86/lenovo/wmi-other.c b/drivers/platform/x86/lenovo/wmi-other.c
index fbb32bf404f2..fdebaa0a9992 100644
--- a/drivers/platform/x86/lenovo/wmi-other.c
+++ b/drivers/platform/x86/lenovo/wmi-other.c
@@ -33,6 +33,7 @@
#include <linux/container_of.h>
#include <linux/device.h>
#include <linux/export.h>
+#include "../firmware_attributes_class.h"
#include <linux/gfp_types.h>
#include <linux/hwmon.h>
#include <linux/idr.h>
@@ -50,7 +51,6 @@
#include "wmi-capdata.h"
#include "wmi-events.h"
#include "wmi-helpers.h"
-#include "../firmware_attributes_class.h"
#define LENOVO_OTHER_MODE_GUID "DC2A8805-3A8C-41BA-A6F7-092E0089CD3B"
diff --git a/drivers/platform/x86/samsung-galaxybook.c b/drivers/platform/x86/samsung-galaxybook.c
index 6382af0b106c..74103c00b0c8 100644
--- a/drivers/platform/x86/samsung-galaxybook.c
+++ b/drivers/platform/x86/samsung-galaxybook.c
@@ -14,6 +14,7 @@
#include <linux/acpi.h>
#include <linux/bits.h>
#include <linux/err.h>
+#include "firmware_attributes_class.h"
#include <linux/i8042.h>
#include <linux/init.h>
#include <linux/input.h>
@@ -27,8 +28,8 @@
#include <linux/sysfs.h>
#include <linux/uuid.h>
#include <linux/workqueue.h>
+
#include <acpi/battery.h>
-#include "firmware_attributes_class.h"
#define DRIVER_NAME "samsung-galaxybook"
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes
[not found] ` <b967ec0f8adb69417a3d81ee5546e4a238e29e11.1787584107.git.sean@starlabs.systems>
@ 2026-08-24 15:20 ` sashiko-bot
2026-08-26 6:07 ` Tzung-Bi Shih
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-08-24 15:20 UTC (permalink / raw)
To: Sean Rhodes; +Cc: dri-devel
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Out-of-bounds array read in get_instance_id macro due to an off-by-one error.
- [High] Out-of-bounds heap read and write in attribute_property_store macro via memchr.
--
--- Patch [1]: [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes ---
commit dff06344a1a1c35eb28b9e59670eeac00408066c
Author: Sean Rhodes <sean@starlabs.systems>
platform/x86: Sort firmware attributes class includes
Move firmware_attributes_class.h into the main include block and sort the
affected includes. This lets the header move replace each include in place.
> diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> index ab46a023cc34d..4ff9003c6589b 100644
> --- a/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> +++ b/drivers/platform/x86/dell/dell-wmi-sysman/sysman.c
> @@ -8,18 +8,19 @@
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include <linux/align.h>
> -#include <linux/fs.h>
> #include <linux/dmi.h>
> -#include <linux/module.h>
> +#include "../../firmware_attributes_class.h"
> +#include <linux/fs.h>
> #include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/nls.h>
> #include <linux/string.h>
> #include <linux/sysfs.h>
> #include <linux/wmi.h>
> +
> #include "dell-wmi-sysman.h"
[Severity: High]
This is a pre-existing issue, but does the get_instance_id() macro in
dell-wmi-sysman.h have an off-by-one error in its loop condition?
drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h:get_instance_id() {
...
for (i = 0; i <= wmi_priv.type##_instances_count; i++) {
if (!(strcmp(kobj->name, wmi_priv.type##_data[i].attribute_name)))
...
}
If no match is found among the valid entries, the loop will evaluate
i = instances_count and access wmi_priv.type##_data[i].attribute_name, which
is memory beyond the allocated array. The subsequent strcmp() function will
then dereference this out-of-bounds heap memory.
[Severity: High]
This is a pre-existing issue, but does the attribute_property_store() macro in
dell-wmi-sysman.h have an out-of-bounds memory access?
drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h:attribute_property_store() {
...
buf_cp = kstrdup(buf, GFP_KERNEL);
if (!buf_cp)
return -ENOMEM;
p = memchr(buf_cp, '\n', count);
if (p != NULL)
*p = '\0';
...
}
kstrdup() determines the allocation size using strlen(buf). If a user
provides an input buffer with an embedded null byte before the newline
character, kstrdup() will allocate a buffer smaller than the user-provided
count.
Subsequently, memchr() searches for a newline character up to count bytes,
reading beyond the dynamically allocated memory. Furthermore, if a newline
character happens to be found in the out-of-bounds memory block, the code
executes *p = '\0', causing an out-of-bounds heap write.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787584107.git.sean@starlabs.systems?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes
[not found] ` <b967ec0f8adb69417a3d81ee5546e4a238e29e11.1787584107.git.sean@starlabs.systems>
2026-08-24 15:20 ` [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes sashiko-bot
@ 2026-08-26 6:07 ` Tzung-Bi Shih
1 sibling, 0 replies; 4+ messages in thread
From: Tzung-Bi Shih @ 2026-08-26 6:07 UTC (permalink / raw)
To: Sean Rhodes
Cc: linux-kernel, Corentin Chary, Luke D. Jones, Denis Benato,
Hans de Goede, Ilpo Järvinen, Prasanth Ksr, Jorge Lopez,
Mark Pearson, Derek J. Clark, Joshua Grisham, platform-driver-x86,
Dell.Client.Kernel, Michael S. Tsirkin, Chen-Yu Tsai, Huacai Chen,
Brian Norris, Julius Werner, Thomas Zimmermann,
Javier Martinez Canillas, Maarten Lankhorst, Maxime Ripard,
David Airlie, Simona Vetter, Florian Fainelli, Danilo Krummrich,
Uwe Kleine-König (The Capable Hub),
Titouan Ameline de Cadeville, Takashi Sakamoto, Kees Cook,
Bjorn Helgaas, chrome-platform, dri-devel, Krzysztof Kozlowski,
Bjorn Andersson, Dmitry Baryshkov, Geert Uytterhoeven,
Arnd Bergmann, Eric Biggers, Luca Weiss, Michal Simek, Sven Peter
On Mon, Aug 24, 2026 at 04:08:58PM +0100, Sean Rhodes wrote:
> Move firmware_attributes_class.h into the main include block and sort the
> affected includes. This lets the header move replace each include in place.
...
> diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
> index 495dc1e31d40..f3d8c5a85762 100644
> --- a/drivers/platform/x86/asus-armoury.c
> +++ b/drivers/platform/x86/asus-armoury.c
> @@ -20,6 +20,7 @@
> #include <linux/dmi.h>
> #include <linux/err.h>
> #include <linux/errno.h>
> +#include "firmware_attributes_class.h"
> #include <linux/fs.h>
> #include <linux/kernel.h>
> #include <linux/kmod.h>
I don't really follow why it is beneficial to make the
firmware_attributes_class.h replacement in-place. Moving relative includes
like "firmware_attributes_class.h" into the <linux/...> block creates an
awkward intermediate state. How about drop patch 1 and simply update the
includes directly in patch 2?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v13 RESEND 3/5] firmware: Rename google firmware directory to coreboot
[not found] ` <557d363a779c3c03bfe939dc2fefd6a4265fa7ad.1787584107.git.sean@starlabs.systems>
@ 2026-08-26 6:07 ` Tzung-Bi Shih
0 siblings, 0 replies; 4+ messages in thread
From: Tzung-Bi Shih @ 2026-08-26 6:07 UTC (permalink / raw)
To: Sean Rhodes
Cc: linux-kernel, Corentin Chary, Luke D. Jones, Denis Benato,
Hans de Goede, Ilpo Järvinen, Prasanth Ksr, Jorge Lopez,
Mark Pearson, Derek J. Clark, Joshua Grisham, platform-driver-x86,
Dell.Client.Kernel, Michael S. Tsirkin, Chen-Yu Tsai, Huacai Chen,
Brian Norris, Julius Werner, Thomas Zimmermann,
Javier Martinez Canillas, Maarten Lankhorst, Maxime Ripard,
David Airlie, Simona Vetter, Florian Fainelli, Danilo Krummrich,
Uwe Kleine-König (The Capable Hub),
Titouan Ameline de Cadeville, Takashi Sakamoto, Kees Cook,
Bjorn Helgaas, chrome-platform, dri-devel, Krzysztof Kozlowski,
Bjorn Andersson, Dmitry Baryshkov, Geert Uytterhoeven,
Arnd Bergmann, Eric Biggers, Luca Weiss, Michal Simek, Sven Peter
On Mon, Aug 24, 2026 at 04:09:00PM +0100, Sean Rhodes wrote:
> Most drivers in drivers/firmware/google are coreboot table drivers rather
> than Google-specific firmware drivers. Rename the directory to coreboot
> and update the Kconfig prompt, build path and maintainer entry.
...
> drivers/gpu/drm/sysfb/Kconfig | 2 +-
The patch has no build-time dependency on other patches in the series. I'm
happy to apply it once v7.3-rc1 is out to move this forward.
For the drivers/gpu/drm/sysfb/Kconfig change, could the DRM maintainers
please provide an Acked-by so this can go through the same tree? Otherwise,
it needs to be separated before the patch can be applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-26 6:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1787584107.git.sean@starlabs.systems>
[not found] ` <b967ec0f8adb69417a3d81ee5546e4a238e29e11.1787584107.git.sean@starlabs.systems>
2026-08-24 15:20 ` [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes sashiko-bot
2026-08-26 6:07 ` Tzung-Bi Shih
[not found] ` <557d363a779c3c03bfe939dc2fefd6a4265fa7ad.1787584107.git.sean@starlabs.systems>
2026-08-26 6:07 ` [PATCH v13 RESEND 3/5] firmware: Rename google firmware directory to coreboot Tzung-Bi Shih
2026-08-17 21:54 [PATCH v13 RESEND 0/5] coreboot CFR firmware attributes Sean Rhodes
2026-08-17 21:54 ` [PATCH v13 RESEND 1/5] platform/x86: Sort firmware attributes class includes Sean Rhodes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox