]> git.ipfire.org Git - thirdparty/linux.git/commit
smb: compress: reject Pattern_V1 when not negotiated
authorAnatolii Shumak <anatoliy.shumak@gmail.com>
Sat, 1 Aug 2026 05:19:52 +0000 (08:19 +0300)
committerSteve French <stfrench@microsoft.com>
Mon, 3 Aug 2026 16:21:22 +0000 (11:21 -0500)
commit0710dd08824a6f3b9892fc5be24acd2e4a36f178
tree062b132d578c20624548a5ec029ddecbc36ac7ab
parent075b74841bd0065a3bda3440873c747938e69b68
smb: compress: reject Pattern_V1 when not negotiated

Pattern_V1 is an optional chained payload type selected during SMB 3.1.1
compression negotiate. conn->compress_pattern was only consulted when
building responses, so a peer that negotiated LZ77 with chained support
could still submit Pattern payloads on the receive path.

Pass allow_pattern through smb_compression_decompress() and reject
SMB3_COMPRESS_PATTERN in the chained decoder when it is false.

Link: https://github.com/namjaejeon/ksmbd/issues/529
Fixes: a08de24c2b85 ("ksmbd: negotiate and decode SMB2 compression")
Signed-off-by: Anatolii Shumak <anatoliy.shumak@gmail.com>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/compress/compress.c
fs/smb/common/compress/compress.h
fs/smb/server/compress.c