Patch "crypto: nitrox - avoid double free on error path in nitrox_sriov_init()" has been added to the 6.0-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

    crypto: nitrox - avoid double free on error path in nitrox_sriov_init()

to the 6.0-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:
     crypto-nitrox-avoid-double-free-on-error-path-in-nit.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 5480b9edfac370a2fb73d67fe6639f2fc99e18b8
Author: Natalia Petrova <n.petrova@xxxxxxxxxx>
Date:   Wed Sep 28 13:25:05 2022 +0300

    crypto: nitrox - avoid double free on error path in nitrox_sriov_init()
    
    [ Upstream commit 094528b6a5a755b1195a01e10b13597d67d1a0e6 ]
    
    If alloc_workqueue() fails in nitrox_mbox_init() it deallocates
    ndev->iov.vfdev and returns error code, but then nitrox_sriov_init()
    calls nitrox_sriov_cleanup() where ndev->iov.vfdev is deallocated
    again.
    
    Fix this by nulling ndev->iov.vfdev after the first deallocation.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 9e5de3e06e54 ("crypto: cavium/nitrox - Add mailbox...")
    Signed-off-by: Natalia Petrova <n.petrova@xxxxxxxxxx>
    Signed-off-by: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>
    Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/crypto/cavium/nitrox/nitrox_mbx.c b/drivers/crypto/cavium/nitrox/nitrox_mbx.c
index 9e7308e39b30..d4e06999af9b 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_mbx.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_mbx.c
@@ -195,6 +195,7 @@ int nitrox_mbox_init(struct nitrox_device *ndev)
 	ndev->iov.pf2vf_wq = alloc_workqueue("nitrox_pf2vf", 0, 0);
 	if (!ndev->iov.pf2vf_wq) {
 		kfree(ndev->iov.vfdev);
+		ndev->iov.vfdev = NULL;
 		return -ENOMEM;
 	}
 	/* enable pf2vf mailbox interrupts */



[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