From nobody Fri Oct 2 13:14:01 2026 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) (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 AE0C34192F7 for ; Fri, 31 Jul 2026 10:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.178.238 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785495027; cv=none; b=g5U2Cm185pzrxHb1bQrXkAfIUCzfLV4isy1w87dI/9ZLueYriavy9Ow8b75qVJI82Q5VWjBDP/EepaXawKWkRZQmkSXMcM4Q+indJwc4OQbnHWCE7PqHqcHLli8iHj5myXOEVbJRWiv40g6cNV7UcGaxNoCgab88x0byyUmVD9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785495027; c=relaxed/simple; bh=DYLxAAnLixKGc2ox0Iz3z6o4OwVhO6x9xij5ze/SxZg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=iayjyEbE4jNiCcSUq9pcrCzNaPJsa7hI3BJL4CFxWXivRwXKHWy2qJoh8U3QtUH4bgg/oI2RzLq02c9lFULnDUS5AgbtxyLv6HKy1yPrnYIBMzLpCGkJfUoC9R1/fvz3wI+jBAXaC4R2X5nEFcVxbmq1sUg+f8iNA+6bpHBGi60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com; spf=fail smtp.mailfrom=windriver.com; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b=HQe26ics; arc=none smtp.client-ip=205.220.178.238 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=windriver.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=windriver.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=windriver.com header.i=@windriver.com header.b="HQe26ics" Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66VAEd8i1872044; Fri, 31 Jul 2026 10:49:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to; s=PPS06212021; bh=3kZwkTE+j FC2XvmgisfMxIkc34mTeH6kbp4nrvm8cVg=; b=HQe26icswlYNcEJF0hkG3W6Lj 6S4W7RJovDkOJ8vWAUBlfareXFwsqKWtE56rEPW7AH6foBlIZQFVBwelHx/kVYB+ KTFuVg8HIYgaoYcO8z5VgjplYC9imL4CpCGNf/uBruzSYjKveG474Qw+HYEtNblt qYtTmHFmkhdVELYVanBsBMLUKYiRWYnbsn2ebpkGrfQsrqpg2/PsqfQUrNr/waD8 CJn3XPSw9YVoAzHnTRbsmcVD8oxlxzGR8lzdIhG9oVLMUGx8iTOnivYiOV4MM2/b semLWkqIN/eH6ZGqjFQEoYdFQJizFybyAIO9qciyqtlNWw755sem+mY8ZMpMQ== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [128.224.246.37]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4frss4g193-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 31 Jul 2026 10:49:37 +0000 (GMT) Received: from ala-exchng01.corp.ad.wrs.com (10.11.224.121) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.61; Fri, 31 Jul 2026 03:49:36 -0700 Received: from pek-yzhou-d3.wrs.com (10.11.232.110) by ala-exchng01.corp.ad.wrs.com (10.11.224.121) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Fri, 31 Jul 2026 03:49:35 -0700 From: Yun Zhou To: , CC: , Subject: [PATCH] configfs: fix lockdep false positive in configfs_depend_item() Date: Fri, 31 Jul 2026 18:49:34 +0800 Message-ID: <20260731104934.1301483-1-yun.zhou@windriver.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDA4MSBTYWx0ZWRfXzr/AHHiHh7E4 jvm0XJ4fmdoaOZr6MYfQcsFWLKYMRT6jiILp1axejpbtgApAelCAhUpwjerAIN77T7Br5SOxhzd +eOF7kEoFlEZW2TGud4CEE3bMzrdFwJpgWN6NDh/t/HExJffWeYo X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDA4MSBTYWx0ZWRfX0TGqiZNz4xXr Vh2S1zimeUnKpO9ZoGa9pD71jbNFyTskRYcLPtEN2GIvm6vp6GSKKXEMHHzmxt6dEUuACDd4xnU lj+NWgqzwU3e9sUlMMY700DHcCVMciiFgthE59ykwsWfy+zimzLnRMhzw/qPRfigBhRMhXnAvCQ OPTQDwubj4b0tIyID5aG6emGWejtB86G1mwFBC0MWLW2L8d3mh8ECiqIgvHM1wMsiZxOFXv0B87 p/ECYbaDJLwfpyYyuboLTBDnXcGx+jFEsERiKmfjcAk4+dbrVdjqzfCkqb0sG0R5jgrXwCfQ3W8 BKXUcNKD//lxYVlqjLepPaRJJLazx521WZd5/abupAssUpMiboMyZM7Kb+qoJOzeNIblLhK1/AS wyjeWJmIIzfkf0fbMy9MM6JDi/2kgbHl9w8nYTc1SlBAh/LveYjAWUiKnw3nfuFHjo4hlNWftjE bKhQqWpcaKdCCb/UBHA== X-Proofpoint-GUID: R-zeyaGgn_Ro1QIfxYJ1q9HBOVcutJJj X-Authority-Analysis: v=2.4 cv=SpqgLvO0 c=1 sm=1 tr=0 ts=6a6c7dc1 cx=c_pps a=Lg6ja3A245NiLSnFpY5YKQ==:117 a=Lg6ja3A245NiLSnFpY5YKQ==:17 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=fTW__CHxibyLmBMfj2wP:22 a=edf1wS77AAAA:8 a=hSkVLCK3AAAA:8 a=t7CeM3EgAAAA:8 a=YRoUv6_MAqsjOt7LjJYA:9 a=DcSpbTIhAlouE1Uv7lRv:22 a=cQPPKAXgyycSBL8etih5:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-ORIG-GUID: R-zeyaGgn_Ro1QIfxYJ1q9HBOVcutJJj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-31_03,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 malwarescore=0 clxscore=1011 phishscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607310081 Content-Type: text/plain; charset="utf-8" configfs_depend_item() and configfs_depend_item_unlocked() acquire the configfs root inode lock to prevent subsystem unregistration while establishing a dependency. When called from a configfs mkdir callback (which holds a parent directory inode lock), lockdep reports a circular dependency because both locks share the same lock class (sb->s_type->i_mutex_key). In practice, the cross-subsystem depend path is only triggered when the caller and target belong to different subsystems. In such cases, the mkdir parent directory is always a subdirectory beneath a subsystem root, never the configfs root itself. Therefore no real deadlock can occur. Use inode_lock_nested() with I_MUTEX_PARENT2 to tell lockdep that this is a different nesting level than the parent lock held by VFS. Fixes: d79d75b5c518 ("fs: configfs: Add unlocked version of configfs_depend= _item()") Reported-by: syzbot+c9f9d646b08f3b6032fe@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3Dc9f9d646b08f3b6032fe Signed-off-by: Yun Zhou --- fs/configfs/dir.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 3c88f13f1ca2..2b05af6fe335 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c @@ -1161,7 +1161,7 @@ int configfs_depend_item(struct configfs_subsystem *s= ubsys, * subsystem is really registered, and so we need to lock out * configfs_[un]register_subsystem(). */ - inode_lock(d_inode(root)); + inode_lock_nested(d_inode(root), I_MUTEX_PARENT2); =20 subsys_sd =3D configfs_find_subsys_dentry(root->d_fsdata, s_item); if (!subsys_sd) { @@ -1256,7 +1256,8 @@ int configfs_depend_item_unlocked(struct configfs_sub= system *caller_subsys, * additional locking to prevent other subsystem from being * unregistered */ - inode_lock(d_inode(root->cg_item.ci_dentry)); + inode_lock_nested(d_inode(root->cg_item.ci_dentry), + I_MUTEX_PARENT2); =20 /* * As we are trying to depend item from other subsystem --=20 2.43.0