]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 13 Mar 2026 05:45:58 +0000 (14:45 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 23 Mar 2026 00:10:22 +0000 (19:10 -0500)
commit0e55f63dd08f09651d39e1b709a91705a8a0ddcb
tree446ce102b796e40ee385f68656f0e3881eb7b0f7
parent309b44ed684496ed3f9c5715d10b899338623512
ksmbd: replace hardcoded hdr2_len with offsetof() in smb2_calc_max_out_buf_len()

After this commit (e2b76ab8b5c9 "ksmbd: add support for read compound"),
response buffer management was changed to use dynamic iov array.
In the new design, smb2_calc_max_out_buf_len() expects the second
argument (hdr2_len) to be the offset of ->Buffer field in the
response structure, not a hardcoded magic number.
Fix the remaining call sites to use the correct offsetof() value.

Cc: stable@vger.kernel.org
Fixes: e2b76ab8b5c9 ("ksmbd: add support for read compound")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb2pdu.c