]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSD: Fix CB_GETATTR status fix
authorChuck Lever <chuck.lever@oracle.com>
Mon, 10 Feb 2025 16:43:31 +0000 (11:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:16:01 +0000 (10:16 +0200)
commitb2b18a9f68f992f0082969ec755d7ca8af76bcb0
tree3d67d2a7018bb8bb23c9a506957f59e2f722a8eb
parent560c03189615c4b89509ab696fdc04b4edad6ed9
NFSD: Fix CB_GETATTR status fix

commit 4990d098433db18c854e75fb0f90d941eb7d479e upstream.

Jeff says:

Now that I look, 1b3e26a5ccbf is wrong. The patch on the ml was correct, but
the one that got committed is different. It should be:

    status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb->cb_status);
    if (unlikely(status || cb->cb_status))

If "status" is non-zero, decoding failed (usu. BADXDR), but we also want to
bail out and not decode the rest of the call if the decoded cb_status is
non-zero. That's not happening here, cb_seq_status has already been checked and
is non-zero, so this ends up trying to decode the rest of the CB_GETATTR reply
when it doesn't exist.

Reported-by: Jeff Layton <jlayton@kernel.org>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219737
Fixes: 1b3e26a5ccbf ("NFSD: fix decoding in nfs4_xdr_dec_cb_getattr")
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