]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix memory leak in smb2_copychunk_range
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 18 May 2021 22:40:11 +0000 (08:40 +1000)
committerSteve French <stfrench@microsoft.com>
Thu, 20 May 2021 00:19:20 +0000 (19:19 -0500)
commitb8c3ee8fe0a4f274a75d9d3818d7e0cefa2b3def
tree5f0b595a798b4d81ca201ca7a2c148730c58b0c5
parenta6729f99710e7980ace7315067b1989666363caa
cifs: fix memory leak in smb2_copychunk_range

When using smb2_copychunk_range() for large ranges we will
run through several iterations of a loop calling SMB2_ioctl()
but never actually free the returned buffer except for the final
iteration.
This leads to memory leaks everytime a large copychunk is requested.

Fixes: 79abd0e36f08 ("CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files")
Cc: <stable@vger.kernel.org>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c