Skip to content

Commit 543d350

Browse files
Punit Agrawalrafaeljw
authored andcommitted
ACPI: SPCR: Check for table version when using precise baudrate
Commit 4d330fe ("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: 4d330fe ("ACPI: SPCR: Support Precise Baud Rate field") Signed-off-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com> Link: https://patch.msgid.link/20251024123125.1081612-1-punit.agrawal@oss.qualcomm.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent dc131bc commit 543d350

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/acpi/spcr.c

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

0 commit comments

Comments
 (0)