From: Jeremy Allison Date: Thu, 4 Jun 2020 04:11:25 +0000 (-0700) Subject: s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an... X-Git-Tag: ldb-2.2.0~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=199a7343eea93eee6682a188d43523b9a325ec33;p=thirdparty%2Fsamba.git s3: libsmb: cli_setatr() and async version. Don't allow attribtes > 16 bits on an old protocol send. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index d603775b25f..6c75759bbca 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -4521,6 +4521,16 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx, return NULL; } + if (attr & 0xFFFF0000) { + /* + * Don't allow attributes greater than + * 16-bits for a 16-bit protocol value. + */ + if (tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER)) { + return tevent_req_post(req, ev); + } + } + SSVAL(state->vwv+0, 0, attr); push_dos_date3((uint8_t *)&state->vwv[1], 0, mtime, smb1cli_conn_server_time_zone(cli->conn));