]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ACPICA: Fix potential infinite loop in acpi_rs_dump_byte_list
authorColin Ian King <colin.king@canonical.com>
Tue, 8 May 2018 21:06:10 +0000 (14:06 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 15 May 2018 08:16:10 +0000 (10:16 +0200)
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 <colin.king@canonical.com>
Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/rsdump.c

index b12a0b1cd9ceda6717eddf6c1e00c1f426ef831e..6601e71b45e332aa0591218353de7bab43292637 100644 (file)
@@ -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]);