]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix slab-out-of-bounds in smb2_allocate_rsp_buf
authorNamjae Jeon <linkinjeon@kernel.org>
Thu, 11 Apr 2024 14:02:15 +0000 (23:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Apr 2024 15:11:43 +0000 (17:11 +0200)
commit3160d9734453a40db248487f8204830879c207f1
treee92d67bfc86d7e1e5573b3eb0432ac0533663e0d
parent6355b468e2a72084e4e9a944b2998f6c62bdd251
ksmbd: fix slab-out-of-bounds in smb2_allocate_rsp_buf

commit c119f4ede3fa90a9463f50831761c28f989bfb20 upstream.

If ->ProtocolId is SMB2_TRANSFORM_PROTO_NUM, smb2 request size
validation could be skipped. if request size is smaller than
sizeof(struct smb2_query_info_req), slab-out-of-bounds read can happen in
smb2_allocate_rsp_buf(). This patch allocate response buffer after
decrypting transform request. smb3_decrypt_req() will validate transform
request size and avoid slab-out-of-bound in smb2_allocate_rsp_buf().

Reported-by: Norbert Szetei <norbert@doyensec.com>
Cc: stable@vger.kernel.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/smb/server/server.c