]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: check iov vector index in ksmbd_conn_write()
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:34:30 +0000 (00:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:58 +0000 (10:41 +0100)
commitb9a3e4549676857bf4b1b5f92200fbb1740dfa2e
treef313d0e659da1ba1afdf95d39f6de4ac8cf28d74
parent01df133b1a7d6ad52ed3e430d43fa930c2d3b8d9
ksmbd: check iov vector index in ksmbd_conn_write()

[ Upstream commit 73f949ea87c7d697210653501ca21efe57295327 ]

If ->iov_idx is zero, This means that the iov vector for the response
was not added during the request process. In other words, it means that
there is a problem in generating a response, So this patch return as
an error to avoid NULL pointer dereferencing problem.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/connection.c