Patch "ACPI: LPIT: Avoid u32 multiplication overflow" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ACPI: LPIT: Avoid u32 multiplication overflow

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-lpit-avoid-u32-multiplication-overflow.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3477c5f4e11d529e0c95a25f380ed503d4833282
Author: Nikita Kiryushin <kiryushin@xxxxxxxx>
Date:   Thu Nov 9 21:08:59 2023 +0300

    ACPI: LPIT: Avoid u32 multiplication overflow
    
    [ Upstream commit 56d2eeda87995245300836ee4dbd13b002311782 ]
    
    In lpit_update_residency() there is a possibility of overflow
    in multiplication, if tsc_khz is large enough (> UINT_MAX/1000).
    
    Change multiplication to mul_u32_u32().
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: eeb2d80d502a ("ACPI / LPIT: Add Low Power Idle Table (LPIT) support")
    Signed-off-by: Nikita Kiryushin <kiryushin@xxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c
index c5598b6d5db8..794962c5c88e 100644
--- a/drivers/acpi/acpi_lpit.c
+++ b/drivers/acpi/acpi_lpit.c
@@ -105,7 +105,7 @@ static void lpit_update_residency(struct lpit_residency_info *info,
 		return;
 
 	info->frequency = lpit_native->counter_frequency ?
-				lpit_native->counter_frequency : tsc_khz * 1000;
+				lpit_native->counter_frequency : mul_u32_u32(tsc_khz, 1000U);
 	if (!info->frequency)
 		info->frequency = 1;
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux