]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SUNRPC: Fix another issue with MIC buffer space
authorChuck Lever <chuck.lever@oracle.com>
Fri, 15 Nov 2019 13:39:07 +0000 (08:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:08:38 +0000 (20:08 +0100)
commitaf075ec9c1670e9f43c2b3163873780996243493
tree7fc58e746f5fb81345c3472943dab8eba9f65b49
parent11c3ef9073a06f849e4ed87db6995107157ae0ed
SUNRPC: Fix another issue with MIC buffer space

[ Upstream commit e8d70b321ecc9b23d09b8df63e38a2f73160c209 ]

xdr_shrink_pagelen() BUG's when @len is larger than buf->page_len.
This can happen when xdr_buf_read_mic() is given an xdr_buf with
a small page array (like, only a few bytes).

Instead, just cap the number of bytes that xdr_shrink_pagelen()
will move.

Fixes: 5f1bc39979d ("SUNRPC: Fix buffer handling of GSS MIC ... ")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/sunrpc/xdr.c