]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cifs: Limit memory used by lock request calls to a page
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Tue, 8 Jan 2019 18:30:56 +0000 (18:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:20:51 +0000 (10:20 +0100)
commit682fb20df442ebbfa2570606b62c9e9308ea1e3a
treec123180215ddf38d35e3c4d9cdd1039144d99808
parent56c3bf188da8367ee3a5cddfc2dd89c1f847da1e
cifs: Limit memory used by lock request calls to a page

[ Upstream commit 92a8109e4d3a34fb6b115c9098b51767dc933444 ]

The code tries to allocate a contiguous buffer with a size supplied by
the server (maxBuf). This could fail if memory is fragmented since it
results in high order allocations for commonly used server
implementations. It is also wasteful since there are probably
few locks in the usual case. Limit the buffer to be no larger than a
page to avoid memory allocation failures due to fragmentation.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/file.c
fs/cifs/smb2file.c