From: Enzo Matsumiya Date: Mon, 13 Apr 2026 19:07:07 +0000 (-0300) Subject: smb: client: compress: fix bad encoding on last LZ77 flag X-Git-Tag: v7.1-rc1~35^2~16 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=a13e942a03feea211c67a97bc6a57f82aa56e4b6;p=thirdparty%2Flinux.git smb: client: compress: fix bad encoding on last LZ77 flag End-of-stream flag could lead to UB because of int promotion (overwriting signed bit). Fix it by changing operand from '1' to '1UL'. Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French --- diff --git a/fs/smb/client/compress/lz77.c b/fs/smb/client/compress/lz77.c index 96e8a8057a772..cdd6b53766b0a 100644 --- a/fs/smb/client/compress/lz77.c +++ b/fs/smb/client/compress/lz77.c @@ -221,7 +221,7 @@ noinline int lz77_compress(const void *src, u32 slen, void *dst, u32 *dlen) } flag <<= (32 - flag_count); - flag |= (1 << (32 - flag_count)) - 1; + flag |= (1UL << (32 - flag_count)) - 1; lz77_write32(flag_pos, flag); *dlen = dstp - dst;