mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 07:03:28 -04:00
platform/x86: dell-wmi-base: Fix handling of ultra performance key
The commit message of commit5fbd827eb9("platform/x86: dell-wmi: Recognise or support new switches") states that the ultra performance key contains additional data after the type and code fields. The event data passed to dell_wmi_process_key() is already parsed, so "buffer" already starts after those two fields. Use the correct index for accessing the first data field to avoid a potential buffer overread. Fixes:5fbd827eb9("platform/x86: dell-wmi: Recognise or support new switches") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://patch.msgid.link/20260612173451.467629-4-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
committed by
Ilpo Järvinen
parent
072841e02c
commit
adfd6846be
@@ -456,7 +456,7 @@ static int dell_wmi_process_key(struct wmi_device *wdev, int type, int code, __l
|
||||
key++;
|
||||
used = 1;
|
||||
} else if (type == 0x0012 && code == 0x000d && remaining > 0) {
|
||||
value = (le16_to_cpu(buffer[2]) == 2);
|
||||
value = (le16_to_cpu(buffer[0]) == 2);
|
||||
used = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user