]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix passing freed memory 'aux_payload_buf'
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:34:28 +0000 (00:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:58 +0000 (10:41 +0100)
commit4a67467f11340eaf3ee849d4945de4d457bf1941
treeb9de22825093eea181367c3163e5c2c68d134c86
parentfbed0adfe5072c73499f0cdf695ddcdb4a73419d
ksmbd: fix passing freed memory 'aux_payload_buf'

[ Upstream commit 59d8d24f4610333560cf2e8fe3f44cafe30322eb ]

The patch e2b76ab8b5c9: "ksmbd: add support for read compound" leads
to the following Smatch static checker warning:

  fs/smb/server/smb2pdu.c:6329 smb2_read()
        warn: passing freed memory 'aux_payload_buf'

It doesn't matter that we're passing a freed variable because nbytes is
zero. This patch set "aux_payload_buf = NULL" to make smatch silence.

Fixes: e2b76ab8b5c9 ("ksmbd: add support for read compound")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
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/smb2pdu.c