From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFBFF606A322 for ; Thu, 3 Dec 2026 15:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Xl2ZZkOU; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=DQ8sgljb DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=CaWOxtWHTC0PmMex1NZuU6u7GAlvyyjcyhF6oe3K2cc=; b=Xl2ZZkOU+mSQnX V8ivWoNRdmf1SYAi/hefZWtDmkggK9P9YhPt+gt4QD4FT/1A+pyN/CppGdxA/rjBY2tE8PApXDhSq Et3jDyH+/wvarnds3M1Y2MIFB52j64BRKN2pER+OHtm0pPmczglHKCQPIWoLPQ6cxKt3bcVHESojz c25epn+L45XzGw6qDRlUIKZMHl2BlGiLRBtvFMTiUbjwTzByM+u6TInad3i5sAfOkYIpYWvKMKqL4 6F3YsYdTyGrq2r6CTIPuyTTyKpU/RXGZPVDRWDz178HJkY16VQiwdC2RHHF3vgU9IGDDtK6khdqRh Zh1rmjxnFV4seLQqMFnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ8iC-0000000F7um-1Xdr; Thu, 03 Dec 2026 15:27:08 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ8i7-0000000F7t2-405w for linux-nvme@lists.infradead.org; Thu, 03 Dec 2026 15:27:06 +0000 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3F5GP73690247; Thu, 3 Dec 2026 15:26:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=CaWOxt WHTC0PmMex1NZuU6u7GAlvyyjcyhF6oe3K2cc=; b=DQ8sgljbpMuU7Hg+SXIqBk GfY0ifsS/ZsHW+4jBId2pcSWTqMYdUEoZKojpRk0ZhxuD4oyRuGHLqtyp0n06vkB oIFpc3LHXZFRTCzupJ5yDEUyvqOxkmgDWF0cT+wedV2lI3pAYrL1PepocFQUVOvw nSRPf5MfJcMHfW8fLcrTulDC9S5e6wZS1ez1F0gPsBRWmLodW8u1Frr5ZD/f2jJ9 dA8Co3DFCVxRYPDW81lMVAQbS07T0hyVphuLex24Vrq0tpQIkKk0e+T4upPjWzuw wfRUMtl9fjBlYOx2SlDNLUTjrxbCvcDqfhACCftBIA2eLJ0EBXc5MsCvbSzeCawA == Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4jan7uwk3d-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 15:26:46 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B3F4SO8720960; Thu, 3 Dec 2026 15:26:45 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4jb7h98sv6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Dec 2026 15:26:45 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B3FQiUq23462484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Dec 2026 15:26:45 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8E635805E; Thu, 3 Dec 2026 15:26:44 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0751A5805C; Thu, 3 Dec 2026 15:26:42 +0000 (GMT) Received: from [9.61.163.177] (unknown [9.61.163.177]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 3 Dec 2026 15:26:41 +0000 (GMT) Message-ID: Date: Thu, 3 Dec 2026 20:56:40 +0530 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/5] nvmet: complete the passthru request after applying command effects To: Guixin Liu , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Daniel Wagner , Hannes Reinecke Cc: linux-nvme@lists.infradead.org References: <20261202115856.2235187-1-kanie@linux.alibaba.com> <20261202115856.2235187-4-kanie@linux.alibaba.com> Content-Language: en-US From: Nilay Shroff In-Reply-To: <20261202115856.2235187-4-kanie@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=Vvy2kO2n c=1 sm=1 tr=0 ts=6b118a36 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=Y2IxJ9c9Rs8Kov3niI8_:22 a=VwQbUJbxAAAA:8 a=SRrdq9N9AAAA:8 a=VnNF1IyMAAAA:8 a=YzCylqg4biqbPm5CCYAA:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: rozSEtTEGA5hQJ4as9ULxcZ3r8xItXKM X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDA2MCBTYWx0ZWRfX2pRUHlYe0VnS oBfhw6v9deHsAOoA+FOvvLdlE6qCxy2spmngIFY6xR981GrB7WteL/wbwSNz9FBaga79NfqN0LU l11EpS3ctQRkUbT8xaBOdqzqPuwnObQ= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDA2MCBTYWx0ZWRfX3C5Y+23P/gYa TXthl5W03X83ouei6V7rXHq4jOYBJkfbXaEye9gqtHWsbUL4e7lXs8SoNbiyS1n2BgI9GYl/NG4 2bvSe2owPw6guVrhdfYC34SDHIN/qYHyOhg0VQASauishLa9qwGz4gNiCwCEp2TExNK9wY5xpxp O6Gk1YyDwscNnnXqG/TT3NDO95lhQuQk0dN64aLg1kstjhUXeN9uIH0dgnC9mCw59o2AUsoUIOM 7XoVjt9FF5eqLK70LDPpbIqAtqY6L2TtMfasonRRECQvQxJNRVqC+A3E0vPuXI2UspRSNr9hrJY Eq5Hz+djXa2QarrgD2zK5R31CC9WhSaZtrJNQAbNSHgksathIFr03pwEPHx0B2qWRdJ7Xvbj3Dw EFNO2FI4LLLlrFR2WT0sx9UiMev84dFhN/mOiMKXPQ/dfPHuu41YiijzDZcEvtPbRRdga8dLl9P 10YesGNyPoiUGIpndqA== X-Proofpoint-ORIG-GUID: jB9j09CewzakEpeEmkcFAiJkTYB8cLmF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-03_04,2026-12-03_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 priorityscore=1501 spamscore=0 impostorscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030060 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_072704_110184_B375591F X-CRM114-Status: GOOD ( 14.76 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" X-Spam-Status: No, score=-10.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 12/2/26 5:28 PM, Guixin Liu wrote: > nvmet_passthru_execute_cmd_work() completes the target request before > applying the command effects. With the loop transport the nvmet_req is > embedded in the host request's pdu, and completing it lets the submitter > free that request, so the subsequent nvme_passthru_end() read of > req->cmd is a use-after-free. Completing early also drops the passthru > reference that keeps the backend controller alive across > nvme_passthru_end(). > > Apply the effects before completing the target request. The backend > request is still freed first, so it is idle before nvme_passthru_end() > flushes scan_work and the reset deadlock does not return. > > Fixes: bc8fb906b0ff9 ("nvme: handle effects after freeing the request") > Cc:stable@vger.kernel.org > Signed-off-by: Guixin Liu Looks good to me: Reviewed-by: Nilay Shroff