* [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3)
@ 2025-10-05 23:30 syzbot
2025-10-06 10:47 ` syzbot
2025-10-09 2:37 ` [PATCH] ntfs3: avoid memcpy size warning Lizhi Xu
0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2025-10-05 23:30 UTC (permalink / raw)
To: almaz.alexandrovich, linux-kernel, ntfs3, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 6093a688a07d Merge tag 'char-misc-6.18-rc1' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=13962458580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e654219ed2546322
dashboard link: https://syzkaller.appspot.com/bug?extid=3a1878433bc1cb97b42a
compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=104b692f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17962458580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/660883fc9bdb/disk-6093a688.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/29f543ec9187/vmlinux-6093a688.xz
kernel image: https://storage.googleapis.com/syzbot-assets/456918818f89/bzImage-6093a688.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/dc6369359d19/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com
loop0: detected capacity change from 0 to 4096
------------[ cut here ]------------
memcpy: detected field-spanning write (size 3656) of single field "hdr1" at fs/ntfs3/index.c:1927 (size 16)
WARNING: CPU: 0 PID: 6065 at fs/ntfs3/index.c:1927 indx_insert_into_buffer.isra.0+0x1041/0x12a0 fs/ntfs3/index.c:1927
Modules linked in:
CPU: 0 UID: 0 PID: 6065 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
RIP: 0010:indx_insert_into_buffer.isra.0+0x1041/0x12a0 fs/ntfs3/index.c:1927
Code: b5 ed a3 fe c6 05 52 41 31 0d 01 90 48 8b 74 24 68 b9 10 00 00 00 48 c7 c2 20 53 a7 8b 48 c7 c7 80 53 a7 8b e8 a0 74 62 fe 90 <0f> 0b 90 90 e9 df fd ff ff e8 71 6d 0b ff e9 4d f4 ff ff e8 67 6d
RSP: 0018:ffffc900039af748 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 00000000ffffffe4 RCX: ffffffff81799b88
RDX: ffff88802ed50000 RSI: ffffffff81799b95 RDI: 0000000000000001
RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff888146f46800
R13: ffff888069637800 R14: 0000000000000e48 R15: ffff88807ae74018
FS: 0000555563ff7500(0000) GS:ffff888124e6a000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fdbd7fd4286 CR3: 0000000069517000 CR4: 0000000000350ef0
Call Trace:
<TASK>
indx_insert_entry+0x1a0/0x460 fs/ntfs3/index.c:1996
ni_add_name+0x4dd/0x820 fs/ntfs3/frecord.c:2995
ni_rename+0x98/0x170 fs/ntfs3/frecord.c:3026
ntfs_rename+0xab9/0xf00 fs/ntfs3/namei.c:332
vfs_rename+0xfa3/0x2290 fs/namei.c:5216
do_renameat2+0x7d8/0xc20 fs/namei.c:5364
__do_sys_rename fs/namei.c:5411 [inline]
__se_sys_rename fs/namei.c:5409 [inline]
__x64_sys_rename+0x7d/0xa0 fs/namei.c:5409
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f780118eec9
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:00007ffcbf706748 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f78013e5fa0 RCX: 00007f780118eec9
RDX: 0000000000000000 RSI: 0000200000000f40 RDI: 00002000000003c0
RBP: 00007f7801211f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f78013e5fa0 R14: 00007f78013e5fa0 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.
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] 4+ messages in thread
* Re: [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3)
2025-10-05 23:30 [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3) syzbot
@ 2025-10-06 10:47 ` syzbot
2025-10-09 2:37 ` [PATCH] ntfs3: avoid memcpy size warning Lizhi Xu
1 sibling, 0 replies; 4+ messages in thread
From: syzbot @ 2025-10-06 10:47 UTC (permalink / raw)
To: almaz.alexandrovich, linux-kernel, ntfs3, syzkaller-bugs
syzbot has bisected this issue to:
commit acdbd67bf939577d6f9e3cf796a005c31cec52d8
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date: Fri Jun 28 15:27:46 2024 +0000
fs/ntfs3: Optimize large writes into sparse file
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=147995cd980000
start commit: 6093a688a07d Merge tag 'char-misc-6.18-rc1' of git://git.k..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=167995cd980000
console output: https://syzkaller.appspot.com/x/log.txt?x=127995cd980000
kernel config: https://syzkaller.appspot.com/x/.config?x=e654219ed2546322
dashboard link: https://syzkaller.appspot.com/bug?extid=3a1878433bc1cb97b42a
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=104b692f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17962458580000
Reported-by: syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com
Fixes: acdbd67bf939 ("fs/ntfs3: Optimize large writes into sparse file")
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ntfs3: avoid memcpy size warning
2025-10-05 23:30 [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3) syzbot
2025-10-06 10:47 ` syzbot
@ 2025-10-09 2:37 ` Lizhi Xu
2025-11-20 9:04 ` Konstantin Komarov
1 sibling, 1 reply; 4+ messages in thread
From: Lizhi Xu @ 2025-10-09 2:37 UTC (permalink / raw)
To: syzbot+3a1878433bc1cb97b42a
Cc: almaz.alexandrovich, linux-kernel, ntfs3, syzkaller-bugs
There are more entries after the structure, use unsafe_memcpy() to avoid
this warning.
syzbot reported:
memcpy: detected field-spanning write (size 3656) of single field "hdr1" at fs/ntfs3/index.c:1927 (size 16)
Call Trace:
indx_insert_entry+0x1a0/0x460 fs/ntfs3/index.c:1996
ni_add_name+0x4dd/0x820 fs/ntfs3/frecord.c:2995
ni_rename+0x98/0x170 fs/ntfs3/frecord.c:3026
ntfs_rename+0xab9/0xf00 fs/ntfs3/namei.c:332
Reported-by: syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3a1878433bc1cb97b42a
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
---
fs/ntfs3/index.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
index 6d1bf890929d..7157cfd70fdc 100644
--- a/fs/ntfs3/index.c
+++ b/fs/ntfs3/index.c
@@ -1924,7 +1924,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
* Undo critical operations.
*/
indx_mark_free(indx, ni, new_vbn >> indx->idx2vbn_bits);
- memcpy(hdr1, hdr1_saved, used1);
+ unsafe_memcpy(hdr1, hdr1_saved, used1,
+ "There are entries after the structure");
indx_write(indx, ni, n1, 0);
}
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ntfs3: avoid memcpy size warning
2025-10-09 2:37 ` [PATCH] ntfs3: avoid memcpy size warning Lizhi Xu
@ 2025-11-20 9:04 ` Konstantin Komarov
0 siblings, 0 replies; 4+ messages in thread
From: Konstantin Komarov @ 2025-11-20 9:04 UTC (permalink / raw)
To: Lizhi Xu, syzbot+3a1878433bc1cb97b42a; +Cc: linux-kernel, ntfs3, syzkaller-bugs
On 10/9/25 04:37, Lizhi Xu wrote:
> There are more entries after the structure, use unsafe_memcpy() to avoid
> this warning.
>
> syzbot reported:
> memcpy: detected field-spanning write (size 3656) of single field "hdr1" at fs/ntfs3/index.c:1927 (size 16)
> Call Trace:
> indx_insert_entry+0x1a0/0x460 fs/ntfs3/index.c:1996
> ni_add_name+0x4dd/0x820 fs/ntfs3/frecord.c:2995
> ni_rename+0x98/0x170 fs/ntfs3/frecord.c:3026
> ntfs_rename+0xab9/0xf00 fs/ntfs3/namei.c:332
>
> Reported-by: syzbot+3a1878433bc1cb97b42a@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=3a1878433bc1cb97b42a
> Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
> ---
> fs/ntfs3/index.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ntfs3/index.c b/fs/ntfs3/index.c
> index 6d1bf890929d..7157cfd70fdc 100644
> --- a/fs/ntfs3/index.c
> +++ b/fs/ntfs3/index.c
> @@ -1924,7 +1924,8 @@ indx_insert_into_buffer(struct ntfs_index *indx, struct ntfs_inode *ni,
> * Undo critical operations.
> */
> indx_mark_free(indx, ni, new_vbn >> indx->idx2vbn_bits);
> - memcpy(hdr1, hdr1_saved, used1);
> + unsafe_memcpy(hdr1, hdr1_saved, used1,
> + "There are entries after the structure");
> indx_write(indx, ni, n1, 0);
> }
>
Thanks for the patch. Applied.
Regards,
Konstantin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-20 9:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-05 23:30 [syzbot] [ntfs3?] WARNING in indx_insert_into_buffer (3) syzbot
2025-10-06 10:47 ` syzbot
2025-10-09 2:37 ` [PATCH] ntfs3: avoid memcpy size warning Lizhi Xu
2025-11-20 9:04 ` Konstantin Komarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox