summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPunit Agrawal <punit.agrawal@oss.qualcomm.com>2025-10-24 13:31:25 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:34:41 -0500
commit3f916a93fc59895a5b18a604cf06ffb9ad96c3c7 (patch)
treec47da4d14f95678f7c56f34253b6023ee27d5de7
parenta2dae25eb803ec9de2c1831d9409e6fca22809d4 (diff)
downloadlinux-3f916a93fc59895a5b18a604cf06ffb9ad96c3c7.tar.gz
linux-3f916a93fc59895a5b18a604cf06ffb9ad96c3c7.tar.bz2
linux-3f916a93fc59895a5b18a604cf06ffb9ad96c3c7.zip
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 <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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/acpi/spcr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index fa12e740386d..52bd7e800b1d 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -152,7 +152,7 @@ int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console)
* Baud Rate field. If this field is zero or not present, Configured
* Baud Rate is used.
*/
- if (table->precise_baudrate)
+ if (table->header.revision >= 4 && table->precise_baudrate)
baud_rate = table->precise_baudrate;
else switch (table->baud_rate) {
case 0: