Skip to contentSkip to conversation

drivers/platform: toshiba_acpi: Fix array out-of-bounds access

PATCH In review Armin Wolf 2 participants 2 messages Jul 9, 2024 – Jul 10, 2024

Subsystems (2)
lore
Share & tools
lore

Armin Wolf

author
#0 lore raw

PATCH 1/1 drivers/platform: toshiba_acpi: Fix array out-of-bounds access

In order to use toshiba_dmi_quirks[] together with the standard DMI matching functions, it must be terminated by a empty entry.

Since this entry is missing, an array out-of-bounds access occurs every time the quirk list is processed.

Fix this by adding the terminating empty entry.

Fixes 3cb1f40dfdc3 ("drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models")
---
 drivers/platform/x86/toshiba_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/toshiba_acpi.c +1 -0
index 3a8d8df89186..d54bccec6ad6 100644
@@ -3299,6 +3299,7 @@ static const struct dmi_system_id toshiba_dmi_quirks[] = {
 		},
 	 .driver_data = (void *)(QUIRK_TURN_ON_PANEL_ON_RESUME | QUIRK_HCI_HOTKEY_QUICKSTART),
 	},
+	{ }
 };
 
 static int toshiba_acpi_add(struct acpi_device *acpi_dev)

--
2.39.2

#1 lore raw

Hi,

Quoted 6 lines · Armin Wolf

In order to use toshiba_dmi_quirks[] together with the standard DMI matching functions, it must be terminated by a empty entry.

Since this entry is missing, an array out-of-bounds access occurs every time the quirk list is processed.

Quoted 6 lines

Fix this by adding the terminating empty entry.

Fixes 3cb1f40dfdc3 ("drivers/platform: toshiba_acpi: Call HCI_PANEL_POWER_ON on resume on some models")

Thank you for your patch.

I have included this patch in the fixes pull-req to Linus which I have just send out.

Regards,

Hans

Quoted 19 lines
---
 drivers/platform/x86/toshiba_acpi.c | 1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/toshiba_acpi.c +1 -1
index 3a8d8df89186..d54bccec6ad6 100644
@@ -3299,6 +3299,7 @@ static const struct dmi_system_id toshiba_dmi_quirks[] = {
 		},
 	 .driver_data = (void *)(QUIRK_TURN_ON_PANEL_ON_RESUME | QUIRK_HCI_HOTKEY_QUICKSTART),
 	},
+	{ }
 };
 
 static int toshiba_acpi_add(struct acpi_device *acpi_dev)
--

2.39.2