diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-02-10 07:53:41 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-02-10 07:53:41 -0800 |
commit | 5a7ec87063c0fbb7706fdccb0cc890757da6f4a1 (patch) | |
tree | 9518c968509f2a630941f0d9ecb2000ab476c866 | |
parent | 4a7bbe7519b6a5d189feeba1d417c8ce9f7e852b (diff) | |
parent | 108a020c64434fed4b69762879d78cd24088b4c7 (diff) | |
download | linux-stable-5a7ec87063c0fbb7706fdccb0cc890757da6f4a1.tar.gz linux-stable-5a7ec87063c0fbb7706fdccb0cc890757da6f4a1.tar.bz2 linux-stable-5a7ec87063c0fbb7706fdccb0cc890757da6f4a1.zip |
Merge tag '6.8-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd
Pull smb server fixes from Steve French:
"Two ksmbd server fixes:
- memory leak fix
- a minor kernel-doc fix"
* tag '6.8-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd:
ksmbd: free aux buffer if ksmbd_iov_pin_rsp_read fails
ksmbd: Add kernel-doc for ksmbd_extract_sharename() function
-rw-r--r-- | fs/smb/server/misc.c | 1 | ||||
-rw-r--r-- | fs/smb/server/smb2pdu.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/fs/smb/server/misc.c b/fs/smb/server/misc.c index 9e8afaa686e3..1a5faa6f6e7b 100644 --- a/fs/smb/server/misc.c +++ b/fs/smb/server/misc.c @@ -261,6 +261,7 @@ out_ascii: /** * ksmbd_extract_sharename() - get share name from tree connect request + * @um: pointer to a unicode_map structure for character encoding handling * @treename: buffer containing tree name and share name * * Return: share name on success, otherwise error diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index ba7a72a6a4f4..0c97d3c86072 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -6173,8 +6173,10 @@ static noinline int smb2_read_pipe(struct ksmbd_work *work) err = ksmbd_iov_pin_rsp_read(work, (void *)rsp, offsetof(struct smb2_read_rsp, Buffer), aux_payload_buf, nbytes); - if (err) + if (err) { + kvfree(aux_payload_buf); goto out; + } kvfree(rpc_resp); } else { err = ksmbd_iov_pin_rsp(work, (void *)rsp, @@ -6384,8 +6386,10 @@ int smb2_read(struct ksmbd_work *work) err = ksmbd_iov_pin_rsp_read(work, (void *)rsp, offsetof(struct smb2_read_rsp, Buffer), aux_payload_buf, nbytes); - if (err) + if (err) { + kvfree(aux_payload_buf); goto out; + } ksmbd_fd_put(work, fp); return 0; |