ksmbd: add low bound validation to FSCTL_QUERY_ALLOCATED_RANGES
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 7 Mar 2023 12:56:07 +0000 (21:56 +0900)
committerSteve French <stfrench@microsoft.com>
Wed, 22 Mar 2023 21:38:33 +0000 (16:38 -0500)
commit342edb60dcda7a409430359b0cac2864bb9dfe44
tree310947d85d407dea229cbf59d85edc4247cd867e
parent2d74ec97131b1179a373b6d521f195c84e894eb6
ksmbd: add low bound validation to FSCTL_QUERY_ALLOCATED_RANGES

Smatch static checker warning:
 fs/ksmbd/vfs.c:1040 ksmbd_vfs_fqar_lseek() warn: no lower bound on 'length'
 fs/ksmbd/vfs.c:1041 ksmbd_vfs_fqar_lseek() warn: no lower bound on 'start'

Fix unexpected result that could caused from negative start and length.

Fixes: f44158485826 ("cifsd: add file operations")
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>
fs/ksmbd/smb2pdu.c