Patch "drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm" has been added to the 5.9-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

    drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm

to the 5.9-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:
     drm-amd-display-fix-potential-integer-overflow-when-.patch
and it can be found in the queue-5.9 subdirectory.

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



commit 82a7d2f600d4ca274913a87d41cd89547425a176
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Tue Aug 18 13:09:14 2020 +0100

    drm/amd/display: fix potential integer overflow when shifting 32 bit variable bl_pwm
    
    [ Upstream commit 1d5503331b12a76266049289747dfd94f1643fde ]
    
    The 32 bit unsigned integer bl_pwm is being shifted using 32 bit arithmetic
    and then being assigned to a 64 bit unsigned integer.  There is a potential
    for a 32 bit overflow so cast bl_pwm to enforce a 64 bit shift operation
    to avoid this.
    
    Addresses-Coverity: ("unintentional integer overflow")
    Fixes: 3ba01817365c ("drm/amd/display: Move panel_cntl specific register from abm to panel_cntl.")
    Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c b/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c
index 43781e77be431..f9456ff6845b6 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c
@@ -75,7 +75,7 @@ static unsigned int calculate_16_bit_backlight_from_pwm(struct dce_panel_cntl *d
 	else
 		bl_pwm &= 0xFFFF;
 
-	current_backlight = bl_pwm << (1 + bl_int_count);
+	current_backlight = (uint64_t)bl_pwm << (1 + bl_int_count);
 
 	if (bl_period == 0)
 		bl_period = 0xFFFF;



[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