smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K
authorSteve French <stfrench@microsoft.com>
Wed, 3 Jun 2020 06:33:58 +0000 (01:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Jun 2020 14:41:55 +0000 (16:41 +0200)
commit6064093f0563ebbe3559e918e82387135962cd70
treef0ddc565290d77da14e036e6bd5fd87fd5bb1778
parentace87a941529de7cdf3732b6ada7a2c02d972cf6
smb3: fix incorrect number of credits when ioctl MaxOutputResponse > 64K

commit e80ddeb2f70ebd0786aa7cdba3e58bc931fa0bb5 upstream.

We were not checking to see if ioctl requests asked for more than
64K (ie when CIFSMaxBufSize was > 64K) so when setting larger
CIFSMaxBufSize then ioctls would fail with invalid parameter errors.
When requests ask for more than 64K in MaxOutputResponse then we
need to ask for more than 1 credit.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2pdu.c