Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793817964; b=d+Mqr0h2qb+JVSTXL9h/hMJQ7DTFgwAcHs+dSlVxmN0283L5m+hpLA053ENSk0TyA57A ttmp1k6pzrxHp7ZQKuCLPEynprUYlBHsZWt8CBaG3RZw90J6yC8zJ7QqLlLWLb9Cwn7e7 ufUJfhfCXfvOmgbKRRVtbSLlfIBhBwDd1AiT8gUyiH2yNJT7x3D9tqa1gyZZDMJ/mtWUh 8Af3g7bC+lVpdicqLjNQJxwHS3+hGwUR7uBzKHnwBJbj0DUFUGErlh2kjOvsb49AkRuKq j9hHmRA0W/1rwFxRhSR3KQI5k9gkaz2rVCMQU+hpp78w2yzaBnN4lFLw3WgUa1m7L0w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793817964; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=NLJi6rN8hlut36Aw8vg6qfBkeXYMUAR3++hw4H28h4E=; b=HkHyma2JEINsgvbdi857fSAsRv0sy4tMG0BQJCC4RBoLqBnj0N5frNNA5VjXoBE1tfdj 15snHV07z5s91IuMdAlVGJe5yAmxgLloGm/H/fD0uu0uWa3o4gl2yDMVJMIb10TvIiWTw TC3m9ilPgLn6sgNdLb04PiqjB471KI6RYYn7QvqHFNAjSTWb6OqSnK477+fyWz/r6B4ub K843aZZYp4XQnx/xz5rdPm5fts31X71k554bqw0YOTgqeCS5aSDd4ayuq1DX0FyLcBbt7 t8w6WyEQ9D6G40veT95v0E/c8uRKvmRkFRmtCyraziIfCvaRqrg9S/mJgYIQQtdgvkQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=crLZvi0A; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04B4C606A332 for ; Wed, 4 Nov 2026 18:46:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=crLZvi0A Received: by smtp.kernel.org (Postfix) with ESMTPSA id 471531F0093A; Wed, 4 Nov 2026 18:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793817963; bh=NLJi6rN8hlut36Aw8vg6qfBkeXYMUAR3++hw4H28h4E=; h=Subject:To:Cc:From:Date; b=crLZvi0Aufj1pEva4tQhlXgKsvfQ3EmltrFsP7b6duVjZ3D4Gq9E2CiHmyyyuZ6Qt WhagzJaqYZQTnSRokmcfEtjkhU+L1g4CRnI4WVnfrXoUqq8RaajgsFaq0F8S02Bo2w PcPZy+FMPwODFl81bGhf14A8NVHcJjv2eyMXyxgU= Subject: FAILED: patch "[PATCH] NFSv4/pnfs: bound the CB_NOTIFY_DEVICEID array count before" failed to apply to 6.1-stable tree To: ben.coddington@hammerspace.com,anna.schumaker@hammerspace.com,bcodding@hammerspace.com Cc: From: Date: Wed, 04 Nov 2026 13:45:59 -0500 Message-ID: <2026110459-venomous-panoramic-8040@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The 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 . 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 # git commit -s git send-email --to '' --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 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(). Fixes: 1be5683b03a7 ("pnfs: CB_NOTIFY_DEVICEID") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Signed-off-by: Anna Schumaker diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 88e1af0fda01..b1bc2c02b5a6 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -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);