]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: transport_ipc: validate payload size before reading handle
authorQianchang Zhao <pioooooooooip@gmail.com>
Wed, 22 Oct 2025 06:27:47 +0000 (15:27 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 13:10:32 +0000 (14:10 +0100)
commit867ffd9d67285612da3f0498ca618297f8e41f01
tree7e142ada3ffa8fc3566b1745268f3795c9b4ba0f
parent1caa8b999d01a7e860a6fa6e639898cb29a50613
ksmbd: transport_ipc: validate payload size before reading handle

commit 6f40e50ceb99fc8ef37e5c56e2ec1d162733fef0 upstream.

handle_response() dereferences the payload as a 4-byte handle without
verifying that the declared payload size is at least 4 bytes. A malformed
or truncated message from ksmbd.mountd can lead to a 4-byte read past the
declared payload size. Validate the size before dereferencing.

This is a minimal fix to guard the initial handle read.

Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers")
Cc: stable@vger.kernel.org
Reported-by: Qianchang Zhao <pioooooooooip@gmail.com>
Signed-off-by: Qianchang Zhao <pioooooooooip@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/transport_ipc.c