From: Colin Ian King Date: Tue, 8 May 2018 21:06:10 +0000 (-0700) Subject: ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list X-Git-Tag: v4.18-rc1~148^2~2^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9df758d96df5773eb7f52878f8875f1c989993da;p=thirdparty%2Fkernel%2Flinux.git ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list There is a potenial infinite loop if acpi_rs_dump_byte_list is called with a Length greater than 255 since the current loop counter is just a u8 and will wrap to zero and never reach the desired value in Length. Fix this by making the loop counter the size type as Length. Signed-off-by: Colin Ian King Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c index b12a0b1cd9ced..6601e71b45e33 100644 --- a/drivers/acpi/acpica/rsdump.c +++ b/drivers/acpi/acpica/rsdump.c @@ -539,7 +539,7 @@ static void acpi_rs_out_title(const char *title) static void acpi_rs_dump_byte_list(u16 length, u8 * data) { - u8 i; + u16 i; for (i = 0; i < length; i++) { acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);