]> git.hungrycats.org Git - linux/commit
NFSD: Prevent a potential integer overflow
authorChuck Lever <chuck.lever@oracle.com>
Tue, 17 Sep 2024 16:15:23 +0000 (12:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:26 +0000 (13:54 +0100)
commit084f797dbc7e52209a4ab6dbc7f0109268754eb9
tree4273619240833fdb0310723ae95abbe058791bae
parent85211611661f3cd33ea9a0286368cea03486f0d2
NFSD: Prevent a potential integer overflow

commit 7f33b92e5b18e904a481e6e208486da43e4dc841 upstream.

If the tag length is >= U32_MAX - 3 then the "length + 4" addition
can result in an integer overflow. Address this by splitting the
decoding into several steps so that decode_cb_compound4res() does
not have to perform arithmetic on the unsafe length value.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4callback.c