[v6.1] KASAN: slab-out-of-bounds Read in udf_get_filelongad

0 views
Skip to first unread message

syzbot

unread,
12:09 PM (6 hours ago) 12:09 PM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ad16b162f21d Linux 6.1.172
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10e517ce580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f0605c5af04d7603
dashboard link: https://syzkaller.appspot.com/bug?extid=a276a48cc0ef23449a36
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2188b271cf45/disk-ad16b162.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/356336b9737c/vmlinux-ad16b162.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3453b10f11f7/bzImage-ad16b162.xz

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

==================================================================
BUG: KASAN: slab-out-of-bounds in udf_get_filelongad+0x152/0x1a0 fs/udf/directory.c:519
Read of size 4 at addr ffff88802e3c2330 by task syz.5.187/5316

CPU: 0 PID: 5316 Comm: syz.5.187 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
udf_get_filelongad+0x152/0x1a0 fs/udf/directory.c:519
udf_current_aext+0x54e/0xb00 fs/udf/inode.c:2132
udf_next_aext+0x101/0x450 fs/udf/inode.c:2057
udf_extend_file fs/udf/inode.c:549 [inline]
udf_setsize+0xa0a/0x10b0 fs/udf/inode.c:1147
udf_setattr+0x404/0x560 fs/udf/file.c:279
notify_change+0xc74/0xf40 fs/attr.c:499
do_truncate+0x1ac/0x240 fs/open.c:65
vfs_truncate+0x262/0x2f0 fs/open.c:111
do_sys_truncate+0xf2/0x1c0 fs/open.c:134
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f5952b9cdd9
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f5950df6028 EFLAGS: 00000246 ORIG_RAX: 000000000000004c
RAX: ffffffffffffffda RBX: 00007f5952e16090 RCX: 00007f5952b9cdd9
RDX: 0000000000000000 RSI: 000000400000f003 RDI: 0000200000000080
RBP: 00007f5952c32d69 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f5952e16128 R14: 00007f5952e16090 R15: 00007ffd243e30c8
</TASK>

Allocated by task 5310:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:936 [inline]
__kmalloc_node_track_caller+0xae/0x230 mm/slab_common.c:956
kmalloc_reserve net/core/skbuff.c:446 [inline]
__alloc_skb+0x22a/0x7e0 net/core/skbuff.c:515
skb_copy+0x139/0x790 net/core/skbuff.c:1732
mac80211_hwsim_tx_frame_no_nl+0xcef/0x12c0 drivers/net/wireless/mac80211_hwsim.c:1729
mac80211_hwsim_tx_frame+0x1b5/0x200 drivers/net/wireless/mac80211_hwsim.c:2058
mac80211_hwsim_beacon_tx+0x61e/0xae0 drivers/net/wireless/mac80211_hwsim.c:2121
__iterate_interfaces+0x243/0x500 net/mac80211/util.c:788
ieee80211_iterate_active_interfaces_atomic+0xd7/0x170 net/mac80211/util.c:824
mac80211_hwsim_beacon+0xb7/0x1b0 drivers/net/wireless/mac80211_hwsim.c:2147
__run_hrtimer kernel/time/hrtimer.c:1747 [inline]
__hrtimer_run_queues+0x54a/0xd50 kernel/time/hrtimer.c:1811
hrtimer_run_softirq+0x183/0x2a0 kernel/time/hrtimer.c:1828
handle_softirqs+0x2a1/0x930 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691

Freed by task 5310:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3700
skb_free_head net/core/skbuff.c:762 [inline]
skb_release_data+0x5db/0x7c0 net/core/skbuff.c:791
skb_release_all net/core/skbuff.c:856 [inline]
__kfree_skb net/core/skbuff.c:870 [inline]
consume_skb+0xa2/0x100 net/core/skbuff.c:1035
ieee80211_rx_handlers+0x4029/0x7560 net/mac80211/rx.c:4075
ieee80211_invoke_rx_handlers net/mac80211/rx.c:4102 [inline]
ieee80211_prepare_and_rx_handle+0x227f/0x6260 net/mac80211/rx.c:4927
__ieee80211_rx_handle_packet net/mac80211/rx.c:5185 [inline]
ieee80211_rx_list+0x25fe/0x2e60 net/mac80211/rx.c:5315
ieee80211_rx_napi+0x1ae/0x3d0 net/mac80211/rx.c:5338
ieee80211_rx include/net/mac80211.h:4849 [inline]
ieee80211_handle_queued_frames+0x105/0x1b0 net/mac80211/main.c:317
tasklet_action_common+0x2fe/0x4d0 kernel/softirq.c:827
handle_softirqs+0x2a1/0x930 kernel/softirq.c:596
__do_softirq kernel/softirq.c:630 [inline]
invoke_softirq kernel/softirq.c:470 [inline]
__irq_exit_rcu+0x13b/0x230 kernel/softirq.c:679
irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline]
sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118
asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691

The buggy address belongs to the object at ffff88802e3c2000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 304 bytes to the right of
512-byte region [ffff88802e3c2000, ffff88802e3c2200)

The buggy address belongs to the physical page:
page:ffffea0000b8f000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802e3c1800 pfn:0x2e3c0
head:ffffea0000b8f000 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00015e0f08 ffffea0001f4d308 ffff888017441c80
raw: ffff88802e3c1800 000000000010000d 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 3037, tgid 3037 (kworker/u4:2), ts 21589638328, free_ts 21560414300
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2559
prep_new_page mm/page_alloc.c:2566 [inline]
get_page_from_freelist+0x1a1e/0x1ab0 mm/page_alloc.c:4357
__alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5657
alloc_slab_page+0x5d/0x160 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2c0 mm/slub.c:1997
___slab_alloc+0xbc6/0x1240 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3398
kmalloc_trace+0x26/0xe0 mm/slab_common.c:1026
kmalloc include/linux/slab.h:563 [inline]
kzalloc include/linux/slab.h:699 [inline]
alloc_bprm+0x56/0x730 fs/exec.c:1537
kernel_execve+0x94/0x9c0 fs/exec.c:2004
call_usermodehelper_exec_async+0x207/0x350 kernel/umh.c:113
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1486 [inline]
free_pcp_prepare mm/page_alloc.c:1536 [inline]
free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3413
free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3508
__stack_depot_save+0x435/0x460 lib/stackdepot.c:506
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_set_track+0x60/0x70 mm/kasan/common.c:53
__kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:329
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3359 [inline]
slab_alloc mm/slub.c:3367 [inline]
__kmem_cache_alloc_lru mm/slub.c:3374 [inline]
kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3383
kmem_cache_zalloc include/linux/slab.h:689 [inline]
lsm_inode_alloc security/security.c:597 [inline]
security_inode_alloc+0x30/0x110 security/security.c:1041
inode_init_always+0x8f8/0xc90 fs/inode.c:232
alloc_inode fs/inode.c:268 [inline]
new_inode_pseudo+0x91/0x1c0 fs/inode.c:1063
new_inode+0x25/0x1c0 fs/inode.c:1091
debugfs_get_inode fs/debugfs/inode.c:72 [inline]
debugfs_create_dir+0xef/0x4b0 fs/debugfs/inode.c:603
binder_init+0x7e/0x222 drivers/android/binder.c:6557
do_one_initcall+0x26a/0x840 init/main.c:1310
do_initcall_level+0x137/0x1e4 init/main.c:1383
do_initcalls+0x4b/0x8a init/main.c:1399

Memory state around the buggy address:
ffff88802e3c2200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802e3c2280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88802e3c2300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88802e3c2380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88802e3c2400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


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