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 9AF723932C9 for ; Sun, 19 Jul 2026 12:13:32 +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=1784463213; cv=none; b=PZFAuYJnB7QvkYpFFALmeQRm2lxJmVxzoAULxI0kWl5ROxkb7VgwVKqFstyWyulY6O7dz3OtipC51ehvuEpF1J0xwU1K2zOagPjMYKww2v5S/Fv1S0TTM+TPCoyy/dNVhLJ77Ek2xxNWBs5qOWt3ww8aOGKeIJJULtkhsUKc+/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784463213; c=relaxed/simple; bh=SEVuYeHG7EG3M6jUXQOcgadJluIBpruY3xd0fJRHbgA=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=NFFHfirU6lR6hCYuEQw2XNkBT9i8psSBZyeMttB7I26iOwbgYMgyHqufkUx9S9mvS9aMElArAkwDmYmOv1hAHmhdJVDZ4lodHnWEF5rfZLhdROhN+xQj0YAg2384MxSyjFMJcThRzv0DPRNSMIP3NiN0UH19EvWD9PFnzbciJek= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zbyBG7Pb; 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="zbyBG7Pb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD52E1F000E9; Sun, 19 Jul 2026 12:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784463212; bh=9zNEDRwq89sCDN+yeZuMXPk0VVo7vwCgXe+dviq5RcY=; h=Subject:To:Cc:From:Date; b=zbyBG7Pb7iOR0eItg255lJJQgmZUOoL1uex4gs+UhnZoc++i6R2ALKuUiutFEGUIc HWIkPiLsWUdFKEk+e83oXgxKt0YHIH6zC+yaBYFkyrpZ8f7qd9w+kXn2ibdsjXZnQF qHYHpyCD1AMWI/lT7Xl70+6RXMHIKaaxyGU50rnQ= Subject: FAILED: patch "[PATCH] nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in" failed to apply to 5.15-stable tree To: kumar.shivam43666@gmail.com,hch@lst.de,kbusch@kernel.org Cc: From: Date: Sun, 19 Jul 2026 14:13:23 +0200 Message-ID: <2026071923-dehydrate-bubble-9f0f@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.15-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.15.y git checkout FETCH_HEAD git cherry-pick -x 4606467a75cfc16721937272ed29462a750b60c8 # git commit -s git send-email --to '' --in-reply-to '2026071923-dehydrate-bubble-9f0f@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 4606467a75cfc16721937272ed29462a750b60c8 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Date: Wed, 18 Mar 2026 18:56:58 -0400 Subject: [PATCH] nvmet-tcp: check INIT_FAILED before nvmet_req_uninit in digest error path In nvmet_tcp_try_recv_ddgst(), when a data digest mismatch is detected, nvmet_req_uninit() is called unconditionally. However, if the command arrived via the nvmet_tcp_handle_req_failure() path, nvmet_req_init() had returned false and percpu_ref_tryget_live() was never executed. The unconditional percpu_ref_put() inside nvmet_req_uninit() then causes a refcount underflow, leading to a WARNING in percpu_ref_switch_to_atomic_rcu, a use-after-free diagnostic, and eventually a permanent workqueue deadlock. Check cmd->flags & NVMET_TCP_F_INIT_FAILED before calling nvmet_req_uninit(), matching the existing pattern in nvmet_tcp_execute_request(). Reviewed-by: Christoph Hellwig Signed-off-by: Shivam Kumar Signed-off-by: Keith Busch diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index 4b8b02341ddc..69e971b179ae 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1310,7 +1310,8 @@ static int nvmet_tcp_try_recv_ddgst(struct nvmet_tcp_queue *queue) queue->idx, cmd->req.cmd->common.command_id, queue->pdu.cmd.hdr.type, le32_to_cpu(cmd->recv_ddgst), le32_to_cpu(cmd->exp_ddgst)); - nvmet_req_uninit(&cmd->req); + if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED)) + nvmet_req_uninit(&cmd->req); nvmet_tcp_free_cmd_buffers(cmd); nvmet_tcp_fatal_error(queue); ret = -EPROTO;