From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86FDF3F8234 for ; Wed, 9 Sep 2026 09:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788947243; cv=none; b=hz5oWx3XwMhqVq1/MErsf/Hw9Lm0V1Hi3zm8sNMncTXEg0+QI8CGXmrFsF80z7bPZ1DH2C1cSRoxlDq1wgID/qHugFJlUBhZxuUoCVTF4cLzYqhTBEW/ruc/74KEdVO8LaXJeBEbj6X0CaG6F2GlZXAd8TiJsXdt7YfKUX+SkpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788947243; c=relaxed/simple; bh=j3UUyvNkLIjpQajKKSkV1BT4aQ8IihPTgPmUrhdjw5M=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=JYHtiypXhRr8+PUXm5kj5o5LZ4g8BOnnqF9upR1X1FnTPYmzF7XcbWiYPIesPYuYf5NvmdMmKh2vFUHdxcLNiPpclmHmEuYD53U8VtO0n24VzbrYWHAPr+9C0t0dFXuKfCAAVVW6vGeIZ3nRr1eT4RqlXxBRVd0quwMETiCvIRk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XlaUs02E; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XlaUs02E" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8F551F00A3A; Wed, 9 Sep 2026 09:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788947242; bh=m00Sy2AsgPOV37YwW5kJrRZMKX6uRZvWapbmkTZX11s=; h=Subject:To:Cc:From:Date; b=XlaUs02E5ccSbpfdQjPldCy7Kl1ySc8ki33PGRvI0/sT9n3p06XyvpMx+LeWP6Z0O fPKzjw0IVoT5qKakpKgpmMjLUWXqoxqBTs8bUS7qlkDjJpNk9kFvh+ABNThSPTFxFG ZqOdL7Ur58giFjKLvw+tibjUcG5BSAvFB5ynOYO8= Subject: FAILED: patch "[PATCH] nvme: add missing SRCU grace period in error path" failed to apply to 5.10-stable tree To: tristan@talencesecurity.com,hch@lst.de,john.g.garry@oracle.com,kbusch@kernel.org,sagi@grimberg.me Cc: From: Date: Wed, 09 Sep 2026 11:43:41 +0200 Message-ID: <2026090941-cherisher-submitter-a8cf@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 5.10-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-5.10.y git checkout FETCH_HEAD git cherry-pick -x ef248d5de4469fb6bbaf8dbe0c4c47800080d648 # git commit -s git send-email --to '' --in-reply-to '2026090941-cherisher-submitter-a8cf@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ef248d5de4469fb6bbaf8dbe0c4c47800080d648 Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Sat, 15 Aug 2026 00:14:27 +0000 Subject: [PATCH] nvme: add missing SRCU grace period in error path nvme_alloc_ns() error path at out_unlink_ns removes ns from the namespace head siblings list with list_del_rcu(&ns->siblings) but does not wait for SRCU readers before freeing the namespace struct. Multipath code iterates the head->list under srcu_read_lock() in nvme_find_path() and nvme_mpath_revalidate_paths(), so a concurrent reader can still hold a reference to ns when kfree(ns) runs. The normal removal path in nvme_ns_remove() correctly calls synchronize_srcu(&ns->head->srcu) after list_del_rcu() to wait for in-progress readers. Add the same grace period in the error path. Fixes: ed754e5deeb1 ("nvme: track shared namespaces") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani Reviewed-by: Sagi Grimberg Reviewed-by: John Garry Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 5f2744be7388..9739ce38b73a 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4345,6 +4345,9 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, struct nvme_ns_info *info) last_path = true; } mutex_unlock(&ctrl->subsys->lock); + + /* guarantee not available in head->list */ + synchronize_srcu(&ns->head->srcu); if (last_path) nvme_put_ns_head(ns->head); nvme_put_ns_head(ns->head);