From nobody Thu Apr 9 18:54:24 2026 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8411883F for ; Fri, 6 Mar 2026 04:38:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772771902; cv=none; b=XoazWcQ/WhvS5xDVBgDD+yW3Gg0Q/Rx6wuS4IUzAahBFyF0Z//2Qf36dScwJu6gxH8EalBrc9Vt9OG0DY5X6OP3VXA/Z1JWgg44eQG/bIHq9Oo4z3HvmZNKEgom9LkhRTGMYRwY+Z4LW7QfdQ0mupONJhAfKPifiKHMLy/O7a+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772771902; c=relaxed/simple; bh=08rjNVHE1pMJea4mwuC52t3HiDNs5KtVIXXjuqSxkVE=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=RLshQlRwjog+uYtrHsz7pKhzp3sfVtwp/sEM90iP56Wf56VP4Xc4iO2nDzOPbcVSJ08ZmsIBOsa+LIz/SLKmg9SVc5Gi8JZUqoeVOz72psSG3M7lzfJP5KOA+IVyIPmTgp4jgpqtTU93TYezC2hTd0ZwqCAlxQaPYw60Jq8os68= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-679c6ef156dso72162880eaf.1 for ; Thu, 05 Mar 2026 20:38:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772771900; x=1773376700; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Th2EXTPf9fA2e4OxWKDtBMcdzCsZH6Yf0Q8yOa6h+Fw=; b=BMXhbL5P/baZeXDR4ID0wkjT5VCMYpA/Whj5HrqVlAzMqI45uPOUEx7fZ/rqIc/n1R BTmmOFwfajCqRM1yquPJvrUxXWQjSpsxQWePfkhqy9RTVz8XYFhzK+rlemzXKdYRRrlB zyoiN3tjYH8cCpT2rFtsZbOQvtCWkM6kuiq++fw1MMjXeE49WOxpIo+hXwmwOHSeXFLb ZNlQUNu6gES/U1+Gv1syo/By87rTW6wLu4lMB+/aWGOc8uBpx8QXQ8OuYX+5qSBYyzL8 ba3ugFctMARD5IqQ9ltb/XOQcU/+vFa3DxOkGkbE8p7HdPaMV0JPJbEzAGs4aCvjlup0 w/Yg== X-Gm-Message-State: AOJu0YxXksDYSC6//UOHVQ9OOWLGJf7PcOXHznK89CRDOYOaqETmhA9n QwmQ9vuk+n3ULhVzEAwf95oLD+QZBODuZBB2Tx+/EUpnp+fef6pFQyp+szFgSbmgd2zoYxSciaO FrivvzAat6XMjrONJ6Fp5K6gLO3W5i64SsbrPe9MTZVfhj87s9sYd5/oUcm8= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:1895:b0:67a:1d5c:b249 with SMTP id 006d021491bc7-67b9bd7617dmr581939eaf.74.1772771899962; Thu, 05 Mar 2026 20:38:19 -0800 (PST) Date: Thu, 05 Mar 2026 20:38:19 -0800 In-Reply-To: <69a9251d.a70a0220.2f119.0003.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69aa5a3b.050a0220.13f275.0009.GAE@google.com> Subject: Forwarded: [PATCH] namei: fix parent inode unlock in end_creating_path() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] namei: fix parent inode unlock in end_creating_path() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git= master end_creating_path() calls end_dirop() which unlocks dentry->d_parent->d_inode. However, the lock was originally acquired on path->dentry by start_dirop() inside filename_create(). If a concurrent operation such as renameat2(RENAME_EXCHANGE) modifies the dentry tree between lock and unlock, dentry->d_parent may no longer point to the originally locked inode, causing an unbalanced unlock. Fix this by unlocking path->dentry directly in end_creating_path() instead of deriving the parent from the child dentry. This ensures the lock and unlock always operate on the same inode regardless of concurrent dentry tree modifications. Reported-by: syzbot+2ed46b6b748df855347f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D2ed46b6b748df855347f Signed-off-by: Deepanshu Kartikey --- fs/namei.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index 58f715f7657e..c861de965d86 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4959,7 +4959,10 @@ EXPORT_SYMBOL(start_creating_path); */ void end_creating_path(const struct path *path, struct dentry *dentry) { - end_creating(dentry); + if (!IS_ERR(dentry)) { + inode_unlock(d_inode(path->dentry)); + dput(dentry); + } mnt_drop_write(path->mnt); path_put(path); } --=20 2.43.0