Unverified Commit 514ecce4 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9092 v2 ksmbd: validate request buffer size in smb2_allocate_rsp_buf()

parents d5bf23ac 2d435efc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -539,6 +539,10 @@ int smb2_allocate_rsp_buf(struct ksmbd_work *work)
	if (cmd == SMB2_QUERY_INFO_HE) {
		struct smb2_query_info_req *req;

		if (get_rfc1002_len(work->request_buf) <
			offsetof(struct smb2_query_info_req, OutputBufferLength))
			return -EINVAL;

		req = smb2_get_msg(work->request_buf);
		if ((req->InfoType == SMB2_O_INFO_FILE &&
		     (req->FileInfoClass == FILE_FULL_EA_INFORMATION ||