Skip to content
Commit ee3fe99f authored by Mark Langsdorf's avatar Mark Langsdorf Committed by Rafael J. Wysocki
Browse files

ACPI: SPCR: check if table->serial_port.access_width is too wide



If table->serial_port.access_width is more than 29, it causes
undefined behavior when ACPI_ACCESS_BIT_WIDTH shifts it to
(1 << ((size) + 2)):

[    0.000000] UBSAN: Undefined behaviour in drivers/acpi/spcr.c:114:11
[    0.000000] shift exponent 102 is too large for 32-bit type 'int'

Use the new ACPI_ACCESS_ defines to test that serial_port.access_width
is less than 30 and set it to 6 if it is not.

Signed-off-by: default avatarMark Langsdorf <mlangsdo@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent bca21755
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment