From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 F27F125333F for ; Fri, 28 Nov 2025 05:21:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764307313; cv=none; b=QYx7yXGm8DvFxbg418zef4zYARnrQjfJ/vnse9F2V9G2PfpDEXgKVI5/nosDrEdMsKAj0cKuHkCoS11l/nBWsmpcrzVc//VDl3yMlt16fGDEU4/k+eqKNOvmXZz6Mk5SjO/iFnX3KEbZusVMur1tpD/2tkM1e9L0kNBOaRyHLXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764307313; c=relaxed/simple; bh=FoQoVDjSUGHsrdv8QRCauuHl4WlKtztg9U6laQwoHxk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JdUd2lCaScKQBccs8cgPxY0M2MwywZmCXW2X5pIed1qJo55adktKkd9VzXC1ZR+i8J4mBWJ8UNbxdOvm8H2ra9+mJV0Rz8yzvStCmT+SZIfTIqzmG4DVIL8DshEhfstBkiQ1m/VvOkh56MbOEU7L/7B8c907PCNgJWTbz/jkfxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=FTDVg1/J; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="FTDVg1/J" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5ARFGoGW005054; Fri, 28 Nov 2025 05:20:53 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=Yt7fov No9RNluqHxlvfJICv+Ax+OdINo9tFjgHrTqHw=; b=FTDVg1/J58NsSSSKaJtygW HVpkyOd3iAdWnd4DoSJUoYiDe9oYmxjECIfeeykL95G5kLqum7oVzR/x1U9tP48y eDWq/C2fDZzb7sEtgKuTB8XRV4+xoUErf5kv+JnPx9DxXUQt+uXqVyTIcGHzLHoh JFSc57k6H2LZ55LOuJNcgWw5c6/sUhCyWzyHg8B0BNSXW57xTQb5w9xcCU67sf8P 9HDEI6cWB328HfT/b5j5WwS6zRaCFC1ruJsETrnhASQkyrRfpQB/tdzzAsojazeo rD7PxhsySRito2x5ZW5QVYZ9cpSOrGP0lkyljzHqlWwttLbeizFssFVkOP0l8C0A == Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4ak4u2b4gp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Nov 2025 05:20:53 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AS51CPu016418; Fri, 28 Nov 2025 05:20:52 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4aks0kka9j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Nov 2025 05:20:52 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AS5KpvA27722304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Nov 2025 05:20:51 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE07C58056; Fri, 28 Nov 2025 05:20:51 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B71E58065; Fri, 28 Nov 2025 05:20:49 +0000 (GMT) Received: from [9.61.122.162] (unknown [9.61.122.162]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 28 Nov 2025 05:20:48 +0000 (GMT) Message-ID: <813a7d60-6211-4048-9267-ec4bd4a75f73@linux.ibm.com> Date: Fri, 28 Nov 2025 10:50:47 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: CVE-2025-40146: blk-mq: fix potential deadlock while nr_requests grown To: Zheng Qixing , Greg KH Cc: cve@kernel.org, linux-kernel@vger.kernel.org, yukuai@fnnas.com, ming.lei@redhat.com, "zhangyi (F)" , yangerkun , Hou Tao References: <2025111256-CVE-2025-40146-b919@gregkh> <15fb6eed-e107-4ef7-a569-3328a02e2c39@huaweicloud.com> <2025112730-semicolon-verse-164a@gregkh> <82df4ae1-2940-4214-b46e-a2f8242b3582@huaweicloud.com> Content-Language: en-US From: Nilay Shroff In-Reply-To: <82df4ae1-2940-4214-b46e-a2f8242b3582@huaweicloud.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTIyMDAyMSBTYWx0ZWRfXyyTUWze33RZQ gvA+OsxYZ2dtecmjKHl+InP6btfyh9uYi7Gte9jZxjREW3ijHBPnT8E8wwDpecgkQIyj7IEGBaz Tm/YXfDieor6V7odkc1NCz42ytUFnBEjWOnEHqbtI4MVz8sjqskEiKioEpDnc0T1negVU50DCh0 zYgrs9uQTHeQYcpkn/821x7+Y6U+bvbGE1VpGSVbWdNx3HotEPPXHq+l5A7vU5fDCV6Ueq/m8Bb aJyJt+WJowTG6z32sL2mwqv9t9ktLzviZcojxpckhf45KYYRU3K2MZ37uPq3MHj1fsaQSi/TF90 6zze1ht+Z9PWOFUrAVLOnhsHvvQLBe1lGX/sjJ4O7cDEKdy+iTvs3y0zSNt6tuXAc6XKlmGT9LV vdgZwkhoB7YxF55JVLQvvnV5XzVsmg== X-Authority-Analysis: v=2.4 cv=SuidKfO0 c=1 sm=1 tr=0 ts=69293135 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=VnNF1IyMAAAA:8 a=EoKfLCrTlFaI_OmIFLMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: bG_V9aFX5x9tEd3Al2RXb9ZS6XSJ_Xud X-Proofpoint-GUID: bG_V9aFX5x9tEd3Al2RXb9ZS6XSJ_Xud X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-25_02,2025-11-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 clxscore=1011 impostorscore=0 malwarescore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511220021 On 11/28/25 6:45 AM, Zheng Qixing wrote: > > 在 2025/11/27 21:39, Greg KH 写道: >> On Thu, Nov 27, 2025 at 09:22:42PM +0800, Zheng Qixing wrote: >>> Hi, >>> >>> Commit b86433721f46 ("blk-mq: fix potential deadlock while nr_requests >>> grown")  aims to avoid a deadlock issue when the queue is frozen and memory >>> reclaim is triggered. >>> >>> However, the sysfs nr_requests update path is already under a >>> memalloc_noio_save() region while the queue is frozen (via >>> blk_mq_freeze_queue()). >> Did the lockdep splat in >> https://lore.kernel.org/all/0659ea8d-a463-47c8-9180-43c719e106eb@linux.ibm.com/ >> not describe the issue here that the commit is attempting to solve? >> >> thanks, >> >> greg k-h > > > The deadlock issue described in this link is about elevator switch path, but the patch modifies sysfs nr_requests update path. > > I didn't identify any potential deadlock issues on this path. If I misunderstood something, could someone help clarify? > > Let me clarify the confusion here. The deadlock reported in [1] requires updates across multiple code paths. There are three distinct paths that need to be fixed to avoid the deadlock. While the report in [1] only exposed the issue in one of these paths, we already knew that all three paths needed changes to fully resolve the problem: 1. Elevator change path (via sysfs attribute) that triggers a scheduler tags update 2. Elevator change path triggered by an nr_hw_queues update which also triggers a scheduler tags update 3. Scheduler tags update triggered through the nr_requests sysfs attribute (please note when nr_requests grows beyond current queue depth it triggers scheduler tags update) The first two code paths were addressed by: commit f5a6604f7a44 (“block: fix lockdep warning caused by lock dependency in elv_iosched_store”), and commit 04225d13aef1 (“block: fix potential deadlock while running nr_hw_queue update”) respectively. The third code path was fixed by: commit b86433721f46 (“blk-mq: fix potential deadlock while nr_requests grown”). Ideally, all of these commits should be referenced as collectively fixing the lockdep splat reported in [1]. I hope this clarifies the situation. Please let me know if you have any further questions. [1] https://lore.kernel.org/all/0659ea8d-a463-47c8-9180-43c719e106eb@linux.ibm.com/ Thanks, --Nilay