FAILED: patch "[PATCH] NFSv4/pnfs: bound the CB_NOTIFY_DEVICEID array count before" failed to apply to 6.1-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 32f0967ea296d447925465c98e7eec71d4e2f755
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026110459-venomous-panoramic-8040@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 32f0967ea296d447925465c98e7eec71d4e2f755 Mon Sep 17 00:00:00 2001
From: Benjamin Coddington <[email protected]>
Date: Tue, 15 Sep 2026 08:22:05 -0400
Subject: [PATCH] NFSv4/pnfs: bound the CB_NOTIFY_DEVICEID array count before
allocating
decode_devicenotify_args() hands the server's notification count straight to kmalloc_objs() as the array length, without checking it against the message that carried it. Bound it the way nfs4xdr.c bounds an attribute length, against xdr_stream_remaining().
fs/nfs/callback_xdr.c +7 -0
@@ -271,6 +271,13 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,if (n ==0 ) goto out; +/* sanity check the count against the remaining stream */ +if (n >xdr_stream_remaining (xdr) / + ((4 *sizeof (uint32_t )) +NFS4_DEVICEID4_SIZE )) { + status =htonl (NFS4ERR_BADXDR ); + goto out; + } + args->devs =kmalloc_objs (*args->devs, n);if (!args->devs) { status =htonl (NFS4ERR_DELAY );
Sasha Levin
maintainerPATCH 1/1 NFSv4/pnfs: bound the CB_NOTIFY_DEVICEID array count before allocating
From: Benjamin Coddington <[email protected]>
[ Upstream commit 32f0967ea296d447925465c98e7eec71d4e2f755 ]
decode_devicenotify_args() hands the server's notification count straight to kmalloc_objs() as the array length, without checking it against the message that carried it. Bound it the way nfs4xdr.c bounds an attribute length, against xdr_stream_remaining().
--- fs/nfs/callback_xdr.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/nfs/callback_xdr.c +7 -0
@@ -272,6 +272,13 @@ __be32 decode_devicenotify_args(struct svc_rqst *rqstp,if (n ==0 ) goto out; +/* sanity check the count against the remaining stream */ +if (n >xdr_stream_remaining (xdr) / + ((4 *sizeof (uint32_t )) +NFS4_DEVICEID4_SIZE )) { + status =htonl (NFS4ERR_BADXDR ); + goto out; + } + args->devs =kmalloc_array (n,sizeof (*args->devs),GFP_KERNEL );if (!args->devs) { status =htonl (NFS4ERR_DELAY );
Signature · 1 line
2.53.0