Patch "thermal/drivers/tsens: Fix null pointer dereference" has been added to the 6.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

    thermal/drivers/tsens: Fix null pointer dereference

to the 6.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:
     thermal-drivers-tsens-fix-null-pointer-dereference.patch
and it can be found in the queue-6.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 38610d46aad497f1b3e154a2a85e90bddc269f41
Author: Aleksandr Mishin <amishin@xxxxxxxxxx>
Date:   Thu Apr 11 14:40:21 2024 +0300

    thermal/drivers/tsens: Fix null pointer dereference
    
    [ Upstream commit d998ddc86a27c92140b9f7984ff41e3d1d07a48f ]
    
    compute_intercept_slope() is called from calibrate_8960() (in tsens-8960.c)
    as compute_intercept_slope(priv, p1, NULL, ONE_PT_CALIB) which lead to null
    pointer dereference (if DEBUG or DYNAMIC_DEBUG set).
    Fix this bug by adding null pointer check.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: dfc1193d4dbd ("thermal/drivers/tsens: Replace custom 8960 apis with generic apis")
    Signed-off-by: Aleksandr Mishin <amishin@xxxxxxxxxx>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
    Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240411114021.12203-1-amishin@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 6d7c16ccb44dc..4edee8d929a75 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -264,7 +264,7 @@ void compute_intercept_slope(struct tsens_priv *priv, u32 *p1,
 	for (i = 0; i < priv->num_sensors; i++) {
 		dev_dbg(priv->dev,
 			"%s: sensor%d - data_point1:%#x data_point2:%#x\n",
-			__func__, i, p1[i], p2[i]);
+			__func__, i, p1[i], p2 ? p2[i] : 0);
 
 		if (!priv->sensor[i].slope)
 			priv->sensor[i].slope = SLOPE_DEFAULT;




[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