Skip to content

Commit 7fa9e0e

Browse files
Punit Agrawalgregkh
authored andcommitted
ACPI: SPCR: Check for table version when using precise baudrate
commit 543d35004007a06ef247acf2fc55efa8388aa741 upstream. Commit 4d330fe54145 ("ACPI: SPCR: Support Precise Baud Rate field") added support to use the precise baud rate available since SPCR 1.09 (revision 4) but failed to check the version of the table provided by the firmware. Accessing an older version of SPCR table causes accesses beyond the end of the table and can lead to garbage data to be used for the baud rate. Check the version of the firmware provided SPCR to ensure that the precise baudrate is vaild before using it. Fixes: 4d330fe54145 ("ACPI: SPCR: Support Precise Baud Rate field") Signed-off-by: Punit Agrawal <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8c845ed commit 7fa9e0e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/acpi/spcr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
152152
* Baud Rate field. If this field is zero or not present, Configured
153153
* Baud Rate is used.
154154
*/
155-
if (table->precise_baudrate)
155+
if (table->header.revision >= 4 && table->precise_baudrate)
156156
baud_rate = table->precise_baudrate;
157157
else switch (table->baud_rate) {
158158
case 0:

0 commit comments

Comments
 (0)