Patch "accel/habanalabs: fix information leak in sec_attest_info()" 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

    accel/habanalabs: fix information leak in sec_attest_info()

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:
     accel-habanalabs-fix-information-leak-in-sec_attest_.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 b97c4f79a163658e7fb04d86df7eb311d2fd45f1
Author: Xingyuan Mo <hdthky0@xxxxxxxxx>
Date:   Fri Dec 8 21:00:59 2023 +0800

    accel/habanalabs: fix information leak in sec_attest_info()
    
    [ Upstream commit a9f07790a4b2250f0140e9a61c7f842fd9b618c7 ]
    
    This function may copy the pad0 field of struct hl_info_sec_attest to user
    mode which has not been initialized, resulting in leakage of kernel heap
    data to user mode. To prevent this, use kzalloc() to allocate and zero out
    the buffer, which can also eliminate other uninitialized holes, if any.
    
    Fixes: 0c88760f8f5e ("habanalabs/gaudi2: add secured attestation info uapi")
    Signed-off-by: Xingyuan Mo <hdthky0@xxxxxxxxx>
    Reviewed-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
    Signed-off-by: Oded Gabbay <ogabbay@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/accel/habanalabs/common/habanalabs_ioctl.c b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
index 8ef36effb95b..a7cd625d82c0 100644
--- a/drivers/accel/habanalabs/common/habanalabs_ioctl.c
+++ b/drivers/accel/habanalabs/common/habanalabs_ioctl.c
@@ -685,7 +685,7 @@ static int sec_attest_info(struct hl_fpriv *hpriv, struct hl_info_args *args)
 	if (!sec_attest_info)
 		return -ENOMEM;
 
-	info = kmalloc(sizeof(*info), GFP_KERNEL);
+	info = kzalloc(sizeof(*info), GFP_KERNEL);
 	if (!info) {
 		rc = -ENOMEM;
 		goto free_sec_attest_info;




[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