From nobody Mon Apr 6 10:30:38 2026 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (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 8FA913BC69E for ; Thu, 19 Mar 2026 11:29:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773919757; cv=none; b=BmrK1GfJ6Q9Xu47AWAwmKUV7InCE+nObqTC7s2sObD99jKYpi4A5Fq3Jie6m6Y66Xhs3jW1oomJl4KPfXOeSZIetA/bipyo+iIpgn38KWbTkMMAl1J/vLUNB3tJVvDKgIndxu0nVHJxQyOWZPi1pnp/txB0e8ykS/cfwxSOT0F4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773919757; c=relaxed/simple; bh=LeQjz7yeaIDtnr/PZzEf6luBnL06GSZAC4SdMvzjU/A=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Lq5dKnSP7bda0hCju449GmuUlZxQ0Y1oDqhz6p0MG6Jk2mj8T2MAUz0CFYQSEvB40V4fdRustR0WJ2/BfOgk2OdE3UNEGUywFBBnp7EeOcg7vKKmJxSFIqwc6sewUpO1wERXUv2hcb7uap6Cgbesq58An09Dg+fLbF1uf1rUehA= 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.72 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-f72.google.com with SMTP id 006d021491bc7-672c40f3873so20605654eaf.2 for ; Thu, 19 Mar 2026 04:29:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773919752; x=1774524552; 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=nBQzk2QWyrSPYtRnDlkigOkS9kWMuows+9XDx4MQe+M=; b=Fr+FmZIrIuteVDtyYJZ4POQxV523rfiDNews+CkynJZXP77jBWVGHNZusjyrKLd3rx jeLR3XaVkKBc1IN2J4PuOq/sBBWRbG+VE0iim02E2/1ysWY/6bzR7n9qvZiwGyLunbrW r9scyoXW0JXyiCL1AdW5Dq0RmOjVKsG2byTC2hGWal//G9BSPgvjLjLmSJMvqnJh00V9 ap97fFfpMNtEctxhtFQPSeH9B6q3V+5O6GD69nUD+0vvknFE2yd8i28Gvg24cOTbJVIe 0RI4iR9qzyj7AbtlLIZvTDHbwrhUZOq1XAUadg+/NBLhZeaqXEdpZzQUphKf4yvE68Ym s29Q== X-Gm-Message-State: AOJu0YxFSYWLRPMaHB02j2jEmIZL6kJIbXMShyWKIrvCbrnkcxPPkaAf CcQFVCj2GK+peKI7Xniz5EHhbrhA8SSX4/3Ou5XsGxochpsSmXGWsqdpu0qLPSqdg65jP1KFaeT tUAQkOFO2HBJhc9pIBqMH6QJ0jRqzD+dT6EXyLsIHhZC7PYRwpum9nF0JhLM= 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:f4a:b0:67c:16a2:ebfc with SMTP id 006d021491bc7-67c16a2fd02mr1927352eaf.45.1773919752426; Thu, 19 Mar 2026 04:29:12 -0700 (PDT) Date: Thu, 19 Mar 2026 04:29:12 -0700 In-Reply-To: <6903e832.050a0220.3344a1.044e.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69bbde08.050a0220.227207.0052.GAE@google.com> Subject: Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2) 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: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2) Author: junjie.cao@linux.dev #syz test diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 2e901d073..c12047153 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -2776,6 +2776,8 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_= inode *new_dir_ni, { int err; struct NTFS_DE *de2 =3D NULL; + struct ATTR_FILE_NAME *de_name =3D (struct ATTR_FILE_NAME *)(de + 1); + struct ATTR_FILE_NAME *fname; int undo =3D 0; =20 /* @@ -2789,14 +2791,30 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntf= s_inode *new_dir_ni, * and then can't restore (add) old name. */ =20 + /* + * Pre-validate: ensure the old name attribute exists in the MFT + * record. On corrupted volumes the attribute may be missing, which + * would cause ni_remove_name() to fail after ni_add_name() has + * already modified the directory, leaving the inode inconsistent. + */ + mi_get_ref(&dir_ni->mi, &de_name->home); + fname =3D ni_fname_name(ni, (struct le_str *)&de_name->name_len, + &de_name->home, NULL, NULL); + if (!fname) + return -ENOENT; + /* * Way 1 - Add new + remove old. */ err =3D ni_add_name(new_dir_ni, ni, new_de); if (!err) { err =3D ni_remove_name(dir_ni, ni, de, &de2, &undo); - WARN_ON(err && - ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo)); + if (err && + ni_remove_name(new_dir_ni, ni, new_de, &de2, &undo)) { + ntfs_inode_warn( + &ni->vfs_inode, + "failed to undo rename, inode is inconsistent"); + } } =20 /*