mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 18:21:24 +02:00
ksmbd: fix memory leak in smb2_handle_negotiate
The allocated memory didn't free under an error
path in smb2_handle_negotiate().
Fixes: e2f34481b2 ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-17815
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
af7c39d971
commit
aa7253c239
|
|
@ -1142,12 +1142,16 @@ int smb2_handle_negotiate(struct ksmbd_work *work)
|
||||||
status);
|
status);
|
||||||
rsp->hdr.Status = status;
|
rsp->hdr.Status = status;
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
|
kfree(conn->preauth_info);
|
||||||
|
conn->preauth_info = NULL;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = init_smb3_11_server(conn);
|
rc = init_smb3_11_server(conn);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
|
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
|
||||||
|
kfree(conn->preauth_info);
|
||||||
|
conn->preauth_info = NULL;
|
||||||
goto err_out;
|
goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user