* [syzbot] [ntfs3?] WARNING in ni_rename (2)
@ 2025-10-30 22:35 syzbot
2025-11-04 6:06 ` Forwarded: " syzbot
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: syzbot @ 2025-10-30 22:35 UTC (permalink / raw)
To: almaz.alexandrovich, bigeasy, linux-kernel, ntfs3, syzkaller-bugs,
tglx
Hello,
syzbot found the following issue on:
HEAD commit: e53642b87a4f Merge tag 'v6.18-rc3-smb-server-fixes' of git..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15ca5932580000
kernel config: https://syzkaller.appspot.com/x/.config?x=41ad820f608cb833
dashboard link: https://syzkaller.appspot.com/bug?extid=4d8e30dbafb5c1260479
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17273fe2580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15374fe2580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c69a7713b158/disk-e53642b8.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/7138dd74fe48/vmlinux-e53642b8.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e715eea6ae3e/bzImage-e53642b8.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/cd997f980581/mount_0.gz
The issue was bisected to:
commit d2d6422f8bd17c6bb205133e290625a564194496
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri Sep 6 10:59:04 2024 +0000
x86: Allow to enable PREEMPT_RT.
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16e84e14580000
final oops: https://syzkaller.appspot.com/x/report.txt?x=15e84e14580000
console output: https://syzkaller.appspot.com/x/log.txt?x=11e84e14580000
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4d8e30dbafb5c1260479@syzkaller.appspotmail.com
Fixes: d2d6422f8bd1 ("x86: Allow to enable PREEMPT_RT.")
loop0: detected capacity change from 0 to 4096
------------[ cut here ]------------
WARNING: CPU: 1 PID: 5981 at fs/ntfs3/frecord.c:3030 ni_rename+0xee/0x100 fs/ntfs3/frecord.c:3029
Modules linked in:
CPU: 1 UID: 0 PID: 5981 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:ni_rename+0xee/0x100 fs/ntfs3/frecord.c:3029
Code: 8b 05 e6 5b a0 0e 48 3b 44 24 10 75 22 44 89 e0 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d e9 09 1b c2 07 cc e8 a3 d9 bc fe 90 <0f> 0b 90 eb c5 e8 88 5c be 07 0f 1f 84 00 00 00 00 00 90 90 90 90
RSP: 0018:ffffc90004327a98 EFLAGS: 00010293
RAX: ffffffff8301e45d RBX: 00000000fffffffe RCX: ffff888032795a00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00000000fffffffe R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffffbfff1dac52f R12: 0000000000000000
R13: ffff88803c0e0000 R14: ffff888057118f60 R15: ffff888057116ba0
FS: 0000555590f59500(0000) GS:ffff888126efc000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f59c3aa1000 CR3: 000000003a7e2000 CR4: 00000000003526f0
Call Trace:
<TASK>
ntfs_rename+0x735/0xbf0 fs/ntfs3/namei.c:332
vfs_rename+0xb34/0xe80 fs/namei.c:5216
do_renameat2+0x6a2/0xa50 fs/namei.c:5364
__do_sys_rename fs/namei.c:5411 [inline]
__se_sys_rename fs/namei.c:5409 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:5409
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f3c2c65efc9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffd158f078 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f3c2c8b5fa0 RCX: 00007f3c2c65efc9
RDX: 0000000000000000 RSI: 00002000000002c0 RDI: 0000200000000580
RBP: 00007f3c2c6e1f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f3c2c8b5fa0 R14: 00007f3c2c8b5fa0 R15: 0000000000000002
</TASK>
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
@ 2025-11-04 6:06 ` syzbot
2025-11-04 6:47 ` syzbot
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-04 6:06 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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: listout@listout.xyz
On 30.10.2025 15:35, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: e53642b87a4f Merge tag 'v6.18-rc3-smb-server-fixes' of git..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=15ca5932580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=41ad820f608cb833
> dashboard link: https://syzkaller.appspot.com/bug?extid=4d8e30dbafb5c1260479
> compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17273fe2580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15374fe2580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/c69a7713b158/disk-e53642b8.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/7138dd74fe48/vmlinux-e53642b8.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/e715eea6ae3e/bzImage-e53642b8.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/cd997f980581/mount_0.gz
>
> The issue was bisected to:
>
> commit d2d6422f8bd17c6bb205133e290625a564194496
> Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Date: Fri Sep 6 10:59:04 2024 +0000
>
> x86: Allow to enable PREEMPT_RT.
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16e84e14580000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=15e84e14580000
> console output: https://syzkaller.appspot.com/x/log.txt?x=11e84e14580000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+4d8e30dbafb5c1260479@syzkaller.appspotmail.com
> Fixes: d2d6422f8bd1 ("x86: Allow to enable PREEMPT_RT.")
#syz test
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 8f9fe1d7a690..895a75b036c3 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3023,12 +3023,14 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
/*
* Way 1 - Add new + remove old.
*/
+ preempt_disable();
err = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = ni_remove_name(dir_ni, ni, de, &de2, &undo);
WARN_ON(err && ni_remove_name(new_dir_ni, ni, new_de, &de2,
&undo));
}
+ preempt_enable();
/*
* Way 2 - Remove old + add new.
--
Regards,
listout
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
2025-11-04 6:06 ` Forwarded: " syzbot
@ 2025-11-04 6:47 ` syzbot
2025-11-10 16:45 ` Forwarded: Add checks for key_len in indx_find syzbot
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-04 6:47 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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: listout@listout.xyz
On 30.10.2025 15:35, syzbot wrote:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: e53642b87a4f Merge tag 'v6.18-rc3-smb-server-fixes' of git..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=15ca5932580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=41ad820f608cb833
> dashboard link: https://syzkaller.appspot.com/bug?extid=4d8e30dbafb5c1260479
> compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17273fe2580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15374fe2580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/c69a7713b158/disk-e53642b8.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/7138dd74fe48/vmlinux-e53642b8.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/e715eea6ae3e/bzImage-e53642b8.xz
> mounted in repro: https://storage.googleapis.com/syzbot-assets/cd997f980581/mount_0.gz
>
> The issue was bisected to:
>
> commit d2d6422f8bd17c6bb205133e290625a564194496
> Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Date: Fri Sep 6 10:59:04 2024 +0000
>
> x86: Allow to enable PREEMPT_RT.
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16e84e14580000
> final oops: https://syzkaller.appspot.com/x/report.txt?x=15e84e14580000
> console output: https://syzkaller.appspot.com/x/log.txt?x=11e84e14580000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+4d8e30dbafb5c1260479@syzkaller.appspotmail.com
> Fixes: d2d6422f8bd1 ("x86: Allow to enable PREEMPT_RT.")
#syz test
diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c
index 8f9fe1d7a690..d9cca094960b 100644
--- a/fs/ntfs3/frecord.c
+++ b/fs/ntfs3/frecord.c
@@ -3023,6 +3023,18 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
/*
* Way 1 - Add new + remove old.
*/
+ struct inode *dir_inode = &dir_ni->vfs_inode;
+ struct inode *new_dir_inode = &new_dir_ni->vfs_inode;
+
+ if (dir_inode == new_dir_inode) {
+ inode_lock(dir_inode);
+ } else if (dir_inode < new_dir_inode) {
+ inode_lock(dir_inode);
+ inode_lock(new_dir_inode);
+ } else {
+ inode_lock(new_dir_inode);
+ inode_lock(dir_inode);
+ }
err = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = ni_remove_name(dir_ni, ni, de, &de2, &undo);
@@ -3042,6 +3054,13 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
* }
*/
+ if (dir_inode == new_dir_inode) {
+ inode_unlock(dir_inode);
+ } else {
+ inode_unlock(dir_inode);
+ inode_unlock(new_dir_inode);
+ }
+
return err;
}
--
Regards,
listout
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Forwarded: Add checks for key_len in indx_find
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
2025-11-04 6:06 ` Forwarded: " syzbot
2025-11-04 6:47 ` syzbot
@ 2025-11-10 16:45 ` syzbot
2026-03-19 11:29 ` Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2025-11-10 16:45 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.
***
Subject: Add checks for key_len in indx_find
Author: kshitijvparanjape@gmail.com
#syz test
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
` (2 preceding siblings ...)
2025-11-10 16:45 ` Forwarded: Add checks for key_len in indx_find syzbot
@ 2026-03-19 11:29 ` syzbot
2026-03-19 15:39 ` syzbot
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2026-03-19 11:29 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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 = NULL;
+ struct ATTR_FILE_NAME *de_name = (struct ATTR_FILE_NAME *)(de + 1);
+ struct ATTR_FILE_NAME *fname;
int undo = 0;
/*
@@ -2789,14 +2791,30 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
* and then can't restore (add) old name.
*/
+ /*
+ * 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 = 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 = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = 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");
+ }
}
/*
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
` (3 preceding siblings ...)
2026-03-19 11:29 ` Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
@ 2026-03-19 15:39 ` syzbot
2026-03-19 15:48 ` syzbot
2026-03-19 16:31 ` syzbot
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2026-03-19 15:39 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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 = NULL;
+ struct ATTR_FILE_NAME *de_name = (struct ATTR_FILE_NAME *)(de + 1);
+ struct ATTR_FILE_NAME *fname;
int undo = 0;
/*
@@ -2789,14 +2791,30 @@ int ni_rename(struct ntfs_inode *dir_ni, struct ntfs_inode *new_dir_ni,
* and then can't restore (add) old name.
*/
+ /*
+ * 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 = 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 = ni_add_name(new_dir_ni, ni, new_de);
if (!err) {
err = 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");
+ }
}
/*
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
` (4 preceding siblings ...)
2026-03-19 15:39 ` syzbot
@ 2026-03-19 15:48 ` syzbot
2026-03-19 16:31 ` syzbot
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2026-03-19 15:48 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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: https://github.com/Lukaaa525/linux-kernel.git ntfs3-ni-rename-fix
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2)
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
` (5 preceding siblings ...)
2026-03-19 15:48 ` syzbot
@ 2026-03-19 16:31 ` syzbot
6 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2026-03-19 16:31 UTC (permalink / raw)
To: linux-kernel, syzkaller-bugs
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: https://github.com/Lukaaa525/linux-kernel.git ntfs3-ni-rename-fix
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-03-19 16:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 22:35 [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
2025-11-04 6:06 ` Forwarded: " syzbot
2025-11-04 6:47 ` syzbot
2025-11-10 16:45 ` Forwarded: Add checks for key_len in indx_find syzbot
2026-03-19 11:29 ` Forwarded: Re: [syzbot] [ntfs3?] WARNING in ni_rename (2) syzbot
2026-03-19 15:39 ` syzbot
2026-03-19 15:48 ` syzbot
2026-03-19 16:31 ` syzbot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox