[v6.6] KASAN: slab-out-of-bounds Read in ntfs_readdir

0 views
Skip to first unread message

syzbot

unread,
Dec 20, 2025, 7:14:32 AM (23 hours ago) Dec 20
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 5fa4793a2d2d Linux 6.6.119
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=102a662a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=691a6769a86ac817
dashboard link: https://syzkaller.appspot.com/bug?extid=ece2a27984b661049b34
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/63699875f1dd/disk-5fa4793a.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8506652fcb6f/vmlinux-5fa4793a.xz
kernel image: https://storage.googleapis.com/syzbot-assets/1b30ceed1710/bzImage-5fa4793a.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ece2a2...@syzkaller.appspotmail.com

ntfs: (device loop1): ntfs_ucstonls(): Unicode name contains characters that cannot be converted to character set cp857. You might want to try to use the mount option nls=utf8.
ntfs: (device loop1): ntfs_filldir(): Skipping unrepresentable inode 0x4.
==================================================================
BUG: KASAN: slab-out-of-bounds in ntfs_filldir fs/ntfs/dir.c:1021 [inline]
BUG: KASAN: slab-out-of-bounds in ntfs_readdir+0xd6f/0x2970 fs/ntfs/dir.c:1200
Read of size 1 at addr ffff88805bf2c999 by task syz-executor/9880

CPU: 1 PID: 9880 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
<TASK>
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xac/0x220 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
ntfs_filldir fs/ntfs/dir.c:1021 [inline]
ntfs_readdir+0xd6f/0x2970 fs/ntfs/dir.c:1200
wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
iterate_dir+0x1c2/0x580 fs/readdir.c:106
__do_sys_getdents64 fs/readdir.c:405 [inline]
__se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f629b9c20b3
Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 3d f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8
RSP: 002b:00007ffea333deb8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 000055557c921640 RCX: 00007f629b9c20b3
RDX: 0000000000008000 RSI: 000055557c921640 RDI: 0000000000000006
RBP: 000055557c921614 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8
R13: 0000000000000016 R14: 000055557c921610 R15: 00007ffea3341260
</TASK>

Allocated by task 9880:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1007 [inline]
__kmalloc+0xb4/0x240 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
ntfs_readdir+0x754/0x2970 fs/ntfs/dir.c:1162
wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
iterate_dir+0x1c2/0x580 fs/readdir.c:106
__do_sys_getdents64 fs/readdir.c:405 [inline]
__se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
kvfree_call_rcu+0xee/0x780 kernel/rcu/tree.c:3452
mld_clear_delrec+0x193/0x5d0 net/ipv6/mcast.c:824
ipv6_mc_destroy_dev+0x45/0x590 net/ipv6/mcast.c:2794
addrconf_ifdown+0x139f/0x1880 net/ipv6/addrconf.c:3968
addrconf_notify+0x6c6/0x1010 net/ipv6/addrconf.c:-1
notifier_call_chain+0x197/0x390 kernel/notifier.c:93
call_netdevice_notifiers_extack net/core/dev.c:2064 [inline]
call_netdevice_notifiers net/core/dev.c:2078 [inline]
unregister_netdevice_many_notify+0xf36/0x1810 net/core/dev.c:11086
unregister_netdevice_many net/core/dev.c:11142 [inline]
default_device_exit_batch+0x9cb/0xa60 net/core/dev.c:11620
ops_exit_list net/core/net_namespace.c:178 [inline]
cleanup_net+0x77f/0xb90 net/core/net_namespace.c:652
process_one_work kernel/workqueue.c:2634 [inline]
process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
kthread+0x2fa/0x390 kernel/kthread.c:388
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Second to last potentially related work creation:
kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
insert_work+0x3d/0x310 kernel/workqueue.c:1651
__queue_work+0xd2c/0x1020 kernel/workqueue.c:1804
call_timer_fn+0x16e/0x530 kernel/time/timer.c:1701
expire_timers kernel/time/timer.c:1747 [inline]
__run_timers+0x558/0x7d0 kernel/time/timer.c:2023
run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2036
handle_softirqs+0x280/0x820 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687

The buggy address belongs to the object at ffff88805bf2c800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 65 bytes to the right of
allocated 344-byte region [ffff88805bf2c800, ffff88805bf2c958)

The buggy address belongs to the physical page:
page:ffffea00016fcb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5bf2c
head:ffffea00016fcb00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017841c80 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5775, tgid 5775 (syz-executor), ts 86532398576, free_ts 24035758152
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
prep_new_page mm/page_alloc.c:1561 [inline]
get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
__alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
alloc_slab_page+0x5d/0x170 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2e0 mm/slub.c:2081
___slab_alloc+0xc6d/0x1300 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3534
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc+0xa4/0x240 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
kzalloc include/linux/slab.h:721 [inline]
fib6_info_alloc+0x32/0xe0 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x44f/0x1200 net/ipv6/route.c:3793
ip6_route_add+0x28/0x130 net/ipv6/route.c:3889
addrconf_add_mroute net/ipv6/addrconf.c:2514 [inline]
addrconf_add_dev+0x257/0x340 net/ipv6/addrconf.c:2532
inet6_addr_add+0x215/0xb60 net/ipv6/addrconf.c:2995
inet6_rtm_newaddr+0x68d/0x940 net/ipv6/addrconf.c:5003
rtnetlink_rcv_msg+0x7c7/0xf10 net/core/rtnetlink.c:6472
netlink_rcv_skb+0x216/0x480 net/netlink/af_netlink.c:2545
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1154 [inline]
free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429
free_contig_range+0xa1/0x160 mm/page_alloc.c:6369
destroy_args+0x80/0x850 mm/debug_vm_pgtable.c:1015
debug_vm_pgtable+0x3cc/0x410 mm/debug_vm_pgtable.c:1400
do_one_initcall+0x1fd/0x750 init/main.c:1250
do_initcall_level+0x137/0x1f0 init/main.c:1312
do_initcalls+0x69/0xd0 init/main.c:1328
kernel_init_freeable+0x3d2/0x570 init/main.c:1565
kernel_init+0x1d/0x1c0 init/main.c:1455
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Memory state around the buggy address:
ffff88805bf2c880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88805bf2c900: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc
>ffff88805bf2c980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88805bf2ca00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805bf2ca80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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 syzk...@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 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

syzbot

unread,
Dec 20, 2025, 11:04:28 AM (19 hours ago) Dec 20
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 5fa4793a2d2d Linux 6.6.119
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14c6f31a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=691a6769a86ac817
dashboard link: https://syzkaller.appspot.com/bug?extid=ece2a27984b661049b34
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=162f1b1a580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=128903c2580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/7e068bc374d5/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ece2a2...@syzkaller.appspotmail.com

ntfs: (device loop0): ntfs_ucstonls(): Unicode name contains characters that cannot be converted to character set cp857. You might want to try to use the mount option nls=utf8.
ntfs: (device loop0): ntfs_filldir(): Skipping unrepresentable inode 0x4.
==================================================================
BUG: KASAN: slab-out-of-bounds in ntfs_filldir fs/ntfs/dir.c:1021 [inline]
BUG: KASAN: slab-out-of-bounds in ntfs_readdir+0xd6f/0x2970 fs/ntfs/dir.c:1200
Read of size 1 at addr ffff888026921d99 by task syz-executor/5885

CPU: 1 PID: 5885 Comm: syz-executor Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
<TASK>
dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xac/0x220 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
ntfs_filldir fs/ntfs/dir.c:1021 [inline]
ntfs_readdir+0xd6f/0x2970 fs/ntfs/dir.c:1200
wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
iterate_dir+0x1c2/0x580 fs/readdir.c:106
__do_sys_getdents64 fs/readdir.c:405 [inline]
__se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f60e75c20b3
Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 62 3d f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8
RSP: 002b:00007fff1fbe8f48 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00005555637da640 RCX: 00007f60e75c20b3
RDX: 0000000000008000 RSI: 00005555637da640 RDI: 0000000000000006
RBP: 00005555637da614 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8
R13: 0000000000000016 R14: 00005555637da610 R15: 00007fff1fbec2f0
</TASK>

Allocated by task 5885:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:198 [inline]
__do_kmalloc_node mm/slab_common.c:1007 [inline]
__kmalloc+0xb4/0x240 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
ntfs_readdir+0x754/0x2970 fs/ntfs/dir.c:1162
wrap_directory_iterator+0x92/0xd0 fs/readdir.c:67
iterate_dir+0x1c2/0x580 fs/readdir.c:106
__do_sys_getdents64 fs/readdir.c:405 [inline]
__se_sys_getdents64+0xe9/0x260 fs/readdir.c:390
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff888026921c00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 65 bytes to the right of
allocated 344-byte region [ffff888026921c00, ffff888026921d58)

The buggy address belongs to the physical page:
page:ffffea00009a4800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26920
head:ffffea00009a4800 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017841c80 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5934, tgid 5934 (kworker/u4:3), ts 94249133373, free_ts 92477856103
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
prep_new_page mm/page_alloc.c:1561 [inline]
get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
__alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
alloc_slab_page+0x5d/0x170 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2e0 mm/slub.c:2081
___slab_alloc+0xc6d/0x1300 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3534
kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
alloc_bprm+0x56/0x9c0 fs/exec.c:1538
kernel_execve+0x98/0x9c0 fs/exec.c:2023
call_usermodehelper_exec_async+0x20b/0x350 kernel/umh.c:110
ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1154 [inline]
free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429
discard_slab mm/slub.c:2127 [inline]
__unfreeze_partials+0x1cf/0x210 mm/slub.c:2667
put_cpu_partial+0x17c/0x250 mm/slub.c:2743
__slab_free+0x31d/0x410 mm/slub.c:3700
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x75/0xe0 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x6e/0x4d0 mm/slab.h:767
slab_alloc_node mm/slub.c:3495 [inline]
__kmem_cache_alloc_node+0x13e/0x260 mm/slub.c:3534
kmalloc_trace+0x2a/0xe0 mm/slab_common.c:1098
kmalloc include/linux/slab.h:600 [inline]
netdevice_queue_work drivers/infiniband/core/roce_gid_mgmt.c:642 [inline]
netdevice_event+0x3a2/0x890 drivers/infiniband/core/roce_gid_mgmt.c:801
notifier_call_chain+0x197/0x390 kernel/notifier.c:93
call_netdevice_notifiers_extack net/core/dev.c:2064 [inline]
call_netdevice_notifiers net/core/dev.c:2078 [inline]
unregister_netdevice_many_notify+0xf36/0x1810 net/core/dev.c:11086
unregister_netdevice_many net/core/dev.c:11142 [inline]
default_device_exit_batch+0x9cb/0xa60 net/core/dev.c:11620
ops_exit_list net/core/net_namespace.c:178 [inline]
cleanup_net+0x77f/0xb90 net/core/net_namespace.c:652

Memory state around the buggy address:
ffff888026921c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888026921d00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc
>ffff888026921d80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888026921e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888026921e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
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.
Reply all
Reply to author
Forward
0 new messages