]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix stream write failure
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 8 May 2025 07:46:11 +0000 (16:46 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:40:21 +0000 (14:40 +0200)
commit795cea4731af29cf2f7f51c9272ac48a4396d145
tree92d35028bfd3d24bf92a8535b92a92d405ea6b27
parent4c8d92233719f09efa419e8dd02e0c95dab02c18
ksmbd: fix stream write failure

[ Upstream commit 1f4bbedd4e5a69b01cde2cc21d01151ab2d0884f ]

If there is no stream data in file, v_len is zero.
So, If position(*pos) is zero, stream write will fail
due to stream write position validation check.
This patch reorganize stream write position validation.

Fixes: 0ca6df4f40cf ("ksmbd: prevent out-of-bounds stream writes by validating *pos")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/server/vfs.c