Patch "ksmbd: fix memory leak in smb2_lock()" has been added to the 6.6-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

    ksmbd: fix memory leak in smb2_lock()

to the 6.6-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:
     ksmbd-fix-memory-leak-in-smb2_lock.patch
and it can be found in the queue-6.6 subdirectory.

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



commit 286ba35caaa733e89fd93699f95a5f6366e6af3e
Author: Zizhi Wo <wozizhi@xxxxxxxxxx>
Date:   Fri Dec 1 22:50:48 2023 +0800

    ksmbd: fix memory leak in smb2_lock()
    
    [ Upstream commit 8f1752723019db900fb60a5b9d0dfd3a2bdea36c ]
    
    In smb2_lock(), if setup_async_work() executes successfully,
    work->cancel_argv will bind the argv that generated by kmalloc(). And
    release_async_work() is called in ksmbd_conn_try_dequeue_request() or
    smb2_lock() to release argv.
    However, when setup_async_work function fails, work->cancel_argv has not
    been bound to the argv, resulting in the previously allocated argv not
    being released. Call kfree() to fix it.
    
    Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
    Signed-off-by: Zizhi Wo <wozizhi@xxxxxxxxxx>
    Acked-by: Namjae Jeon <linkinjeon@xxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 269fbfb3cd678..2b248d45d40ae 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -7074,6 +7074,7 @@ int smb2_lock(struct ksmbd_work *work)
 						      smb2_remove_blocked_lock,
 						      argv);
 				if (rc) {
+					kfree(argv);
 					err = -ENOMEM;
 					goto out;
 				}




[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