]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
smb: client: increase number of PDUs allowed in a compound request
authorPaulo Alcantara <pc@manguebit.com>
Tue, 30 Jan 2024 00:04:44 +0000 (21:04 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Mar 2024 12:34:52 +0000 (13:34 +0100)
commit2fdb5551e35b0dcb61d85f70d0963813f53d377f
tree256b0ac3dc41f60f25b1416f1b4f6586b6ea3381
parent2b1f28ee49dad6d45bb7d8ab4b492570f7aeaa77
smb: client: increase number of PDUs allowed in a compound request

[ Upstream commit 11d4d1dba3315f73d2d1d386f5bf4811a8241d45 ]

With the introduction of SMB2_OP_QUERY_WSL_EA, the client may now send
5 commands in a single compound request in order to query xattrs from
potential WSL reparse points, which should be fine as we currently
allow up to 5 PDUs in a single compound request.  However, if
encryption is enabled (e.g. 'seal' mount option) or enforced by the
server, current MAX_COMPOUND(5) won't be enough as we require an extra
PDU for the transform header.

Fix this by increasing MAX_COMPOUND to 7 and, while we're at it, add
an WARN_ON_ONCE() and return -EIO instead of -ENOMEM in case we
attempt to send a compound request that couldn't include the extra
transform header.

Signed-off-by: Paulo Alcantara <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/cifsglob.h
fs/smb/client/transport.c