cifs: Fix potential OOB access of lock element array
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 8 Jan 2019 18:30:57 +0000 (18:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2019 21:07:10 +0000 (22:07 +0100)
commit5c467ac09db61069e409d1249c23a9deff747410
tree1331bf5dddcd2c5d160d800067cb4c754f3b5c6e
parent4092ad400ea6ef5c31871ccefdaf809ef8dd32cc
cifs: Fix potential OOB access of lock element array

commit b9a74cde94957d82003fb9f7ab4777938ca851cd upstream.

If maxBuf is small but non-zero, it could result in a zero sized lock
element array which we would then try and access OOB.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/file.c
fs/cifs/smb2file.c