ksmbd: add low bound validation to FSCTL_SET_ZERO_DATA
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 5 Mar 2023 12:04:00 +0000 (21:04 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:47:49 +0000 (12:47 +0200)
commitd897216325d7f6cf4feecbdea8025e12d374cd98
tree1415f95f68b2a0a588d9360b69b85debffb28b4f
parent7a83bb6d56a5c5713969cabc9ff000cbad0f1aac
ksmbd: add low bound validation to FSCTL_SET_ZERO_DATA

[ Upstream commit 2d74ec97131b1179a373b6d521f195c84e894eb6 ]

Smatch static checker warning:
 fs/ksmbd/smb2pdu.c:7759 smb2_ioctl()
 warn: no lower bound on 'off'

Fix unexpected result that could caused from negative off and bfz.

Fixes: b5e5f9dfc915 ("ksmbd: check invalid FileOffset and BeyondFinalZero in FSCTL_ZERO_DATA")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ksmbd/smb2pdu.c