From nobody Mon Apr 6 10:32:31 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 362742C15B0 for ; Thu, 19 Mar 2026 15:39:24 +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=1773934765; cv=none; b=Ob/eqWDCrKhb/vfetaFwFbfl4YNTwRprb+ikT0bWozEelZPy6lvGVp2lFM9R76csz7vXsUGP/ea6OihovQrzQaYnt9izCfOENs2cyv+cqw1jlcbFsxVHlyBLs0Ek0dhiNOtu/nG4XkRTvqnm+eNsg2tLPQnuYUMOe6J1SyT33+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773934765; c=relaxed/simple; bh=LeQjz7yeaIDtnr/PZzEf6luBnL06GSZAC4SdMvzjU/A=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=R/vxJ5YjxCSYEM/buFp27qyQWXn5jkEVAjo7gLPo1kC0TBu24Liff/5iwUrpb0yyxs9zo1Sq75f3INeUZZIQE/aZHP8kEeJSuq9qvkXsa2ne//6tynJC/hiGUsfFWlizprFW0Y2K6kcQjJ2dRIzgjnibccTLUcJbTQxrgjWYnds= 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-67be26d440fso19261826eaf.1 for ; Thu, 19 Mar 2026 08:39:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773934763; x=1774539563; 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=gkoSLoaMW1LATh6+2ip8GW7iIts7Qs82aHwH8EVn3MYaqKH3ibdF6m/5Zm6Z2GY05R VELovFOG6cT7dzXmmS8n971mbfOiNsJF0PAuP9EUx5oGPzgbw0yHt8cdLpjdSV7w7xks lsZWZNer0dJobt6f2PtwIRHzDEUhCTovwBLt7iCh9GpznujTtwOzraShSsswA92A6hR8 G4cgsz9ANd7TeHBpv1qx+UYtqRaH+AJFIFS6orRRjqgAoYD1GNvKxa55JWWebAOhaYcn xoab4rOnBMnFTVQXNUpvMzzvBwVs5Y7kqLL9/LmzbunnCMx3c3LfOeq+IbjSSBJDjADR tp+g== X-Gm-Message-State: AOJu0YwDq9CEyVwGFFAHaS2UMFKIEZzIkok0JdAdp+Jz1Ap39Atm/r/O MCvuHh6vx114CvPsKrHexCRCvDgKq6jX5JUpnVB7BouqPF9aMGVUxnHbIUIB7egeh0UQ2NlZP58 N/AyeOyRss/AEVCUkbdw0CBMxmh4mYOWUYWUPZpF/xbJBJUjSQIq3YehE6BY= 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:1ca2:b0:67b:a667:f51f with SMTP id 006d021491bc7-67c0da65603mr5264508eaf.6.1773934763089; Thu, 19 Mar 2026 08:39:23 -0700 (PDT) Date: Thu, 19 Mar 2026 08:39:23 -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: <69bc18ab.050a0220.1b2d94.000d.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 /*