Skip to content

Commit b2eb3e6

Browse files
mwilczyrafaeljw
authored andcommitted
ACPI: processor: Fix uninitialized access of buf in acpi_set_pdc_bits()
A bug was introduced during unification of setting CAP_SMP_T_SWCOORD for the _PDC and _OSC methods. The third u32 in the buffer is never cleared before setting bits on it. The memory is not guaranteed to be zero as it was allocated by kmalloc() instead of kzalloc(). Fix this by initializing the third u32 in the buffer to 0. Fixes: b9e8d01 ("ACPI: processor: Set CAP_SMP_T_SWCOORD in arch_acpi_set_proc_cap_bits()") Signed-off-by: Michal Wilczynski <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4eb2bd2 commit b2eb3e6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/acpi/processor_pdc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static void acpi_set_pdc_bits(u32 *buf)
1919
{
2020
buf[0] = ACPI_PDC_REVISION_ID;
2121
buf[1] = 1;
22+
buf[2] = 0;
2223

2324
/* Twiddle arch-specific bits needed for _PDC */
2425
arch_acpi_set_proc_cap_bits(&buf[2]);

0 commit comments

Comments
 (0)