mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
smbd: Protect smbd_smb2_getinfo_send() against invalid quota files
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14367 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri May 29 09:55:10 UTC 2020 on sn-devel-184
This commit is contained in:
parent
7f16ecc5ce
commit
d18c76666f
@ -1,4 +1,2 @@
|
||||
^samba3.smbtorture_s3.crypt_client.SMB2-QUOTA1.smbtorture\(nt4_dc_smb1\)
|
||||
^samba3.smbtorture_s3.plain.SMB2-QUOTA1.smbtorture\(fileserver\)
|
||||
# ntvfs returns NT_STATUS_NOT_SUPPORTED
|
||||
^samba3.smbtorture_s3.plain.SMB2-QUOTA1.smbtorture\(ad_dc_ntvfs\)
|
||||
|
@ -547,12 +547,21 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
|
||||
struct ndr_pull *ndr_pull = NULL;
|
||||
DATA_BLOB sid_buf = data_blob_null;
|
||||
TALLOC_CTX *tmp_ctx = talloc_init("geninfo_quota");
|
||||
bool ok;
|
||||
|
||||
if (!tmp_ctx) {
|
||||
tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
ok = check_fsp_ntquota_handle(conn, smbreq, fsp);
|
||||
if (!ok) {
|
||||
DBG_INFO("no valid QUOTA HANDLE\n");
|
||||
TALLOC_FREE(tmp_ctx);
|
||||
tevent_req_nterror(req, NT_STATUS_INVALID_HANDLE);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
ndr_pull = ndr_pull_init_blob(&in_input_buffer, tmp_ctx);
|
||||
if (!ndr_pull) {
|
||||
TALLOC_FREE(tmp_ctx);
|
||||
|
Loading…
Reference in New Issue
Block a user