diff options
author | Zizhi Wo <wozizhi@huawei.com> | 2023-12-01 22:50:48 +0800 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-12-05 20:43:23 -0600 |
commit | 8f1752723019db900fb60a5b9d0dfd3a2bdea36c (patch) | |
tree | fbc5986e38333a08299168f043a9402614d612ac /fs/smb/server | |
parent | 33cc938e65a98f1d29d0a18403dbbee050dcad9a (diff) | |
download | linux-stable-8f1752723019db900fb60a5b9d0dfd3a2bdea36c.tar.gz linux-stable-8f1752723019db900fb60a5b9d0dfd3a2bdea36c.tar.bz2 linux-stable-8f1752723019db900fb60a5b9d0dfd3a2bdea36c.zip |
ksmbd: fix memory leak in smb2_lock()
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@huawei.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/server')
-rw-r--r-- | fs/smb/server/smb2pdu.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index d369b98a6e10..bf1dea10c9e7 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -7080,6 +7080,7 @@ skip: smb2_remove_blocked_lock, argv); if (rc) { + kfree(argv); err = -ENOMEM; goto out; } |