From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796221470; b=o1VlAODoVHFck56lWaoZmZVMOqfRUT1gZqmCVuYllXNTwILmrbcUHO7oo3CQmKUbxvpd 72pq1TTBpb7f+oKXx1u0N62wwCJR/4AGOUx3ClGGqhvt9Y+yDaexdVwBkWq0krZq2BqYw +cVSTy46wAi8ulA3EPpGXRoqevny1tlzb/hk8eQkvOvNCHKaHj0zlafH54E3g9T/x+Lwe VZI9Adn7Kubq2dlGojzC4XdTq6J/pWKHMK1F734Mdv3DJxQO/yg711zyXyM864mVrwyHe RGInGMFd5uGpwJmymfcu0O+1ISX/gLywnGaI2jRqqgjvNafU3FptmWfJy/T4oLQvmww== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221470; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=fUs6rbYDeduX73bYOAKOBlsiCiMeggObBULunoaBjto=; b=EX/CBNZ1e3qdLfYbwam+gtKBK4alqBL6CFCo4/JbsrDKDQyIrcKoRRxCCyFs3FdC2QZL lnZLiX/7hxZChopUkb/kZjVaJnGH1nGwxwJaZCc2tCY/pozUjiP+OB6/A++PG7JEFixmW qFbMXhRDwr90QwsvR1UBtzeG1sfhAPrsYyYb7OZI7c5ulOJQppvQiIALhU0YtmP4gqdQx BsqL91OQ/gO5OZYNJ2b3kPUp1hztTEkP48dcKrNu9To0v0wq3cHglJKbrWJgGYJI+notD 1nt1tE9xfr3CQVTFQXV5Fv5e2C5BhujLOt0HQwWPf9V4lvfSoCJRgu/ITWpSa6S30IA== 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=rCRObNxB; 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 7678E606A31A for ; Wed, 2 Dec 2026 14:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=rCRObNxB Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF4BF1F00893; Wed, 2 Dec 2026 14:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221470; bh=fUs6rbYDeduX73bYOAKOBlsiCiMeggObBULunoaBjto=; h=Subject:To:Cc:From:Date; b=rCRObNxBbEQ8ZtfDv/bIQnivKQJiaBjwecv77rDbrT/KTkH1qLmXU06nEVZeD0wKr 1ZXPXJ87Zq6sjYq3NXXAxKeim16lB284GlncTNzm5VP47Cizk5pe5vz2kbKKSUofzo QQbRL0LPzkKvGlMvLjMUP109ILMrN2eFhSNsLJx8= Subject: FAILED: patch "[PATCH] nvme: reject invalid reconnect_delay sysfs values" failed to apply to 6.1-stable tree To: shao.mingyin@zte.com.cn,kbusch@kernel.org Cc: From: Date: Wed, 02 Dec 2026 14:51:40 +0100 Message-ID: <2026120240-olympics-conceded-8003@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 f92fe8dea19c743eb9e4d998ae0384344dd40091 # git commit -s git send-email --to '' --in-reply-to '2026120240-olympics-conceded-8003@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f92fe8dea19c743eb9e4d998ae0384344dd40091 Mon Sep 17 00:00:00 2001 From: Shao Mingyin Date: Thu, 5 Nov 2026 21:58:07 +0800 Subject: [PATCH] nvme: reject invalid reconnect_delay sysfs values nvme_ctrl_reconnect_delay_store() stores whatever kstrtou32() accepted into opts->reconnect_delay without validating it. The nvme-fabrics option parser refuses reconnect_delay values that are zero or negative, and the rest of the driver relies on that: nvme_ctrl_loss_tmo_store() computes opts->max_reconnects = DIV_ROUND_UP(ctrl_loss_tmo, opts->reconnect_delay); Writing 0 to reconnect_delay and then a positive value to ctrl_loss_tmo therefore divides by zero in the kernel. In addition, a value larger than INT_MAX is truncated to a negative int in the assignment and silently bypasses the checks done by the fabrics parser. Reject zero and values that do not fit into the signed int field. Fixes: 764075fdcb2f ("nvme: expose reconnect_delay and ctrl_loss_tmo via sysfs") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c index 3724b5ce03a0..9672ca3f74d2 100644 --- a/drivers/nvme/host/sysfs.c +++ b/drivers/nvme/host/sysfs.c @@ -632,6 +632,9 @@ static ssize_t nvme_ctrl_reconnect_delay_store(struct device *dev, if (err) return err; + if (!v || v > INT_MAX) + return -EINVAL; + ctrl->opts->reconnect_delay = v; return count; }