| From cfcfe0b38a66bbc4122c78a2b75e1b97b3534761 Mon Sep 17 00:00:00 2001 | |
| From: Aldo Ariel Panzardo <qwe.aldo@gmail.com> | |
| Date: Tue, 15 Sep 2026 09:56:36 -0300 | |
| Subject: nfsd: propagate SETXATTR value decode errors | |
| From: Aldo Ariel Panzardo <qwe.aldo@gmail.com> | |
| commit cfcfe0b38a66bbc4122c78a2b75e1b97b3534761 upstream. | |
| nfsd4_decode_setxattr() stores the status returned while assembling a | |
| non-empty attribute value, but then unconditionally returns nfs_ok. An | |
| allocation failure can therefore leave a NULL value buffer paired with a | |
| non-zero length and allow compound processing to continue. | |
| Return the decoder status so that the operation stops on the original | |
| error. | |
| Fixes: 23e50fe3a5e6 ("nfsd: implement the xattr functions and en/decode logic") | |
| Cc: stable@vger.kernel.org | |
| Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com> | |
| Reviewed-by: Jeff Layton <jlayton@kernel.org> | |
| Link: https://patch.msgid.link/20260915125636.2849626-1-qwe.aldo@gmail.com | |
| Signed-off-by: Chuck Lever <cel@kernel.org> | |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
| --- | |
| fs/nfsd/nfs4xdr.c | 2 +- | |
| 1 file changed, 1 insertion(+), 1 deletion(-) | |
| --- a/fs/nfsd/nfs4xdr.c | |
| +++ b/fs/nfsd/nfs4xdr.c | |
| @@ -2251,7 +2251,7 @@ nfsd4_decode_setxattr(struct nfsd4_compo | |
| &setxattr->setxa_buf, size); | |
| } | |
| - return nfs_ok; | |
| + return status; | |
| } | |
| static __be32 |