Commit 26b9398
committed
smb: client: fix memory leak during error handling for POSIX mkdir
JIRA: https://issues.redhat.com/browse/RHEL-96872
commit 1fe4a44
Author: Jethro Donaldson <[email protected]>
Date: Thu May 15 01:23:23 2025 +1200
smb: client: fix memory leak during error handling for POSIX mkdir
The response buffer for the CREATE request handled by smb311_posix_mkdir()
is leaked on the error path (goto err_free_rsp_buf) because the structure
pointer *rsp passed to free_rsp_buf() is not assigned until *after* the
error condition is checked.
As *rsp is initialised to NULL, free_rsp_buf() becomes a no-op and the leak
is instead reported by __kmem_cache_shutdown() upon subsequent rmmod of
cifs.ko if (and only if) the error path has been hit.
Pass rsp_iov.iov_base to free_rsp_buf() instead, similar to the code in
other functions in smb2pdu.c for which *rsp is assigned late.
Cc: [email protected]
Signed-off-by: Jethro Donaldson <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Paulo Alcantara <[email protected]>1 parent eb50bc4 commit 26b9398
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2975 | 2975 | | |
2976 | 2976 | | |
2977 | 2977 | | |
2978 | | - | |
| 2978 | + | |
2979 | 2979 | | |
2980 | 2980 | | |
2981 | 2981 | | |
| |||
0 commit comments