Skip to content

Commit 17d5b13

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: fix wrong DataOffset validation of create context
If ->DataOffset of create context is 0, DataBuffer size is not correctly validated. This patch change wrong validation code and consider tag length in request. Cc: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21824 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent bf26f1b commit 17d5b13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/server/oplock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ struct create_context *smb2_find_context_vals(void *open_req, const char *tag, i
14811481
name_len < 4 ||
14821482
name_off + name_len > cc_len ||
14831483
(value_off & 0x7) != 0 ||
1484-
(value_off && (value_off < name_off + name_len)) ||
1484+
(value_len && value_off < name_off + (name_len < 8 ? 8 : name_len)) ||
14851485
((u64)value_off + value_len > cc_len))
14861486
return ERR_PTR(-EINVAL);
14871487

0 commit comments

Comments
 (0)