Patch "firmware: qcom: scm: fix a NULL-pointer dereference" has been added to the 6.11-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

    firmware: qcom: scm: fix a NULL-pointer dereference

to the 6.11-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:
     firmware-qcom-scm-fix-a-null-pointer-dereference.patch
and it can be found in the queue-6.11 subdirectory.

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



commit d5f6f3e71fc3ad0d245e7160fe117acf69480f88
Author: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
Date:   Mon Sep 30 10:33:28 2024 +0200

    firmware: qcom: scm: fix a NULL-pointer dereference
    
    [ Upstream commit ca61d6836e6f4442a77762e1074d2706a2a6e578 ]
    
    Some SCM calls can be invoked with __scm being NULL (the driver may not
    have been and will not be probed as there's no SCM entry in device-tree).
    Make sure we don't dereference a NULL pointer.
    
    Fixes: 449d0d84bcd8 ("firmware: qcom: scm: smc: switch to using the SCM allocator")
    Reported-by: Rudraksha Gupta <guptarud@xxxxxxxxx>
    Closes: https://lore.kernel.org/lkml/692cfe9a-8c05-4ce4-813e-82b3f310019a@xxxxxxxxx/
    Reviewed-by: Konrad Dybcio <konradybcio@xxxxxxxxxx>
    Tested-by: Rudraksha Gupta <guptarud@xxxxxxxxx>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Reviewed-by: Stephan Gerhold <stephan.gerhold@xxxxxxxxxx>
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
    Reviewed-by: Kuldeep Singh <quic_kuldsing@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240930083328.17904-1-brgl@xxxxxxxx
    Signed-off-by: Bjorn Andersson <andersson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 0f5ac346bda43..a50d8e8d0f1b8 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -207,7 +207,7 @@ static DEFINE_SPINLOCK(scm_query_lock);
 
 struct qcom_tzmem_pool *qcom_scm_get_tzmem_pool(void)
 {
-	return __scm->mempool;
+	return __scm ? __scm->mempool : NULL;
 }
 
 static enum qcom_scm_convention __get_convention(void)




[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