[v6.1] KASAN: slab-out-of-bounds Write in udf_write_aext

3 views
Skip to first unread message

syzbot

unread,
Mar 11, 2023, 9:12:51 AM3/11/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 11585e2f8b9d Linux 6.1.17
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1358fa5cc80000
kernel config: https://syzkaller.appspot.com/x/.config?x=740051f61d5ba775
dashboard link: https://syzkaller.appspot.com/bug?extid=600a32676df180ebc4af
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/344bdc1161a0/disk-11585e2f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fbb847890efd/vmlinux-11585e2f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/3a06888da390/Image-11585e2f.gz.xz

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

==================================================================
BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2095
Write of size 4 at addr ffff0001096883f0 by task syz-executor.3/13689

CPU: 1 PID: 13689 Comm: syz-executor.3 Not tainted 6.1.17-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:395
kasan_report+0xd4/0x130 mm/kasan/report.c:495
__asan_report_store_n_noabort+0x28/0x34 mm/kasan/report_generic.c:367
udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2095
udf_add_entry+0x11e0/0x28b0 fs/udf/namei.c:482
udf_mkdir+0x158/0x7e0 fs/udf/namei.c:681
vfs_mkdir+0x334/0x4e4 fs/namei.c:4036
do_mkdirat+0x20c/0x610 fs/namei.c:4061
__do_sys_mkdirat fs/namei.c:4076 [inline]
__se_sys_mkdirat fs/namei.c:4074 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4074
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Allocated by task 3840:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:955 [inline]
__kmalloc_node_track_caller+0xd0/0x1c0 mm/slab_common.c:975
kmalloc_reserve net/core/skbuff.c:437 [inline]
__alloc_skb+0x174/0x580 net/core/skbuff.c:509
alloc_skb include/linux/skbuff.h:1267 [inline]
alloc_uevent_skb+0x78/0x1e4 lib/kobject_uevent.c:290
uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline]
kobject_uevent_net_broadcast+0x2bc/0x528 lib/kobject_uevent.c:409
kobject_uevent_env+0x530/0x874 lib/kobject_uevent.c:593
kobject_synth_uevent+0x818/0xa70 lib/kobject_uevent.c:208
uevent_store+0x34/0x84 drivers/base/core.c:2656
dev_attr_store+0x6c/0x90 drivers/base/core.c:2358
sysfs_kf_write+0x200/0x280 fs/sysfs/file.c:136
kernfs_fop_write_iter+0x334/0x48c fs/kernfs/file.c:330
call_write_iter include/linux/fs.h:2205 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x610/0x914 fs/read_write.c:584
ksys_write+0x15c/0x26c fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__arm64_sys_write+0x7c/0x90 fs/read_write.c:646
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Freed by task 3840:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4c/0x80 mm/kasan/common.c:52
kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516
____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:244
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook mm/slub.c:1750 [inline]
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674
kfree+0x104/0x228 mm/slab_common.c:1007
skb_free_head net/core/skbuff.c:760 [inline]
skb_release_data+0x488/0x6b0 net/core/skbuff.c:789
skb_release_all net/core/skbuff.c:854 [inline]
__kfree_skb net/core/skbuff.c:868 [inline]
consume_skb+0xa0/0x178 net/core/skbuff.c:1033
skb_free_datagram+0x20/0x30 net/core/datagram.c:322
netlink_recvmsg+0x488/0xde4 net/netlink/af_netlink.c:2008
____sys_recvmsg+0x234/0x69c
___sys_recvmsg net/socket.c:2743 [inline]
__sys_recvmsg+0x27c/0x350 net/socket.c:2773
__do_sys_recvmsg net/socket.c:2783 [inline]
__se_sys_recvmsg net/socket.c:2780 [inline]
__arm64_sys_recvmsg+0x80/0x94 net/socket.c:2780
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

Last potentially related work creation:
kasan_save_stack+0x40/0x70 mm/kasan/common.c:45
__kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486
kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496
insert_work+0x64/0x384 kernel/workqueue.c:1358
__queue_work+0xe04/0x14e4 kernel/workqueue.c:1517
delayed_work_timer_fn+0x74/0x90 kernel/workqueue.c:1643
call_timer_fn+0x270/0xcf4 kernel/time/timer.c:1474
expire_timers kernel/time/timer.c:1514 [inline]
__run_timers+0x584/0x718 kernel/time/timer.c:1790
run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1803
__do_softirq+0x37c/0xff4 kernel/softirq.c:571

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

The buggy address belongs to the physical page:
page:000000008f8f5b9d refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x149688
head:000000008f8f5b9d order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002600
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000109688280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff000109688300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff000109688380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff000109688400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff000109688480: 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.

syzbot

unread,
Mar 11, 2023, 1:52:59 PM3/11/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d214f240b0f6 Linux 5.15.100
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13e30792c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2ce2e44a77402c69
dashboard link: https://syzkaller.appspot.com/bug?extid=998afeb1be1fed64fd51
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/16b7e741b1bc/disk-d214f240.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d659bc0db8bc/vmlinux-d214f240.xz
kernel image: https://storage.googleapis.com/syzbot-assets/64813dcb1631/Image-d214f240.gz.xz

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

==================================================================
BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2100
Write of size 4 at addr ffff000106d003f0 by task syz-executor.4/20141

CPU: 1 PID: 20141 Comm: syz-executor.4 Not tainted 5.15.100-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_store_n_noabort+0x40/0x4c mm/kasan/report_generic.c:325
udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2100
udf_add_entry+0x11e0/0x28b0 fs/udf/namei.c:482
udf_mkdir+0x158/0x7e0 fs/udf/namei.c:681
vfs_mkdir+0x2e4/0x4a8 fs/namei.c:3937
do_mkdirat+0x260/0x67c fs/namei.c:3963
__do_sys_mkdirat fs/namei.c:3978 [inline]
__se_sys_mkdirat fs/namei.c:3976 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:3976
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 <unknown>:584

Allocated by task 3585:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
__kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc_node_track_caller+0x20c/0x384 mm/slub.c:4963
kmalloc_reserve+0xe8/0x270 net/core/skbuff.c:356
__alloc_skb+0x1a4/0x584 net/core/skbuff.c:427
skb_copy+0xcc/0x53c net/core/skbuff.c:1588
mac80211_hwsim_tx_frame_no_nl+0xb98/0x14a8 drivers/net/wireless/mac80211_hwsim.c:1569
mac80211_hwsim_tx_frame+0x1c4/0x1f8 drivers/net/wireless/mac80211_hwsim.c:1788
mac80211_hwsim_beacon_tx+0x400/0x7d4 drivers/net/wireless/mac80211_hwsim.c:1842
__iterate_interfaces+0x204/0x484 net/mac80211/util.c:793
ieee80211_iterate_active_interfaces_atomic+0xd4/0x180 net/mac80211/util.c:829
mac80211_hwsim_beacon+0xa0/0x184 drivers/net/wireless/mac80211_hwsim.c:1865
__run_hrtimer kernel/time/hrtimer.c:1685 [inline]
__hrtimer_run_queues+0x578/0xfd0 kernel/time/hrtimer.c:1749
hrtimer_run_softirq+0x158/0x220 kernel/time/hrtimer.c:1766
__do_softirq+0x3a8/0xf60 kernel/softirq.c:558

Freed by task 19681:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0x1b0/0x480 mm/slub.c:4559
skb_free_head net/core/skbuff.c:655 [inline]
skb_release_data+0x404/0x5fc net/core/skbuff.c:677
skb_release_all net/core/skbuff.c:742 [inline]
__kfree_skb net/core/skbuff.c:756 [inline]
kfree_skb_reason+0x2bc/0x60c net/core/skbuff.c:776
kfree_skb include/linux/skbuff.h:1122 [inline]
ieee80211_iface_work+0x640/0xa80 net/mac80211/iface.c:1497
process_one_work+0x84c/0x14b8 kernel/workqueue.c:2306
worker_thread+0x910/0x1034 kernel/workqueue.c:2453
kthread+0x37c/0x45c kernel/kthread.c:319
ret_from_fork+0x10/0x20 <unknown>:870

Last potentially related work creation:
kasan_save_stack+0x38/0x68 mm/kasan/common.c:38
kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348
insert_work+0x64/0x394 kernel/workqueue.c:1362
__queue_work+0xc40/0x12c4 kernel/workqueue.c:1528
delayed_work_timer_fn+0x74/0x90 kernel/workqueue.c:1653
call_timer_fn+0x24c/0xbc8 kernel/time/timer.c:1421
expire_timers kernel/time/timer.c:1461 [inline]
__run_timers+0x584/0x718 kernel/time/timer.c:1737
run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750
__do_softirq+0x3a8/0xf60 kernel/softirq.c:558

The buggy address belongs to the object at ffff000106d00000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 496 bytes to the right of
512-byte region [ffff000106d00000, ffff000106d00200)
The buggy address belongs to the page:
page:0000000022a883b6 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x146d00
head:0000000022a883b6 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc00041d6600 0000000500000005 ffff0000c0002600
raw: ffff000106d03c00 000000008010000b 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000106d00280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff000106d00300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff000106d00380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff000106d00400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff000106d00480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

syzbot

unread,
Mar 18, 2023, 9:18:43 AM3/18/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 7eaef76fbc46 Linux 6.1.20
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17157f06c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=28c36fe4d02f8c88
dashboard link: https://syzkaller.appspot.com/bug?extid=600a32676df180ebc4af
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=117ef416c80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1059c8a6c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/610a00ba4375/disk-7eaef76f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/57c1310f9a30/vmlinux-7eaef76f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/81999f717d3b/bzImage-7eaef76f.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/3f0bb7d773ce/mount_0.gz

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

loop0: detected capacity change from 0 to 2048
UDF-fs: error (device loop0): udf_process_sequence: Primary Volume Descriptor not found!
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
==================================================================
BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x6a7/0x7a0 fs/udf/inode.c:2089
Write of size 4 at addr ffff888022d79bf8 by task syz-executor109/3627

CPU: 1 PID: 3627 Comm: syz-executor109 Not tainted 6.1.20-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x15f/0x4f0 mm/kasan/report.c:395
kasan_report+0x136/0x160 mm/kasan/report.c:495
udf_write_aext+0x6a7/0x7a0 fs/udf/inode.c:2089
udf_add_entry+0x17b7/0x3350 fs/udf/namei.c:482
udf_mkdir+0x1a8/0xaa0 fs/udf/namei.c:681
vfs_mkdir+0x3b6/0x590 fs/namei.c:4036
do_mkdirat+0x260/0x520 fs/namei.c:4061
__do_sys_mkdir fs/namei.c:4081 [inline]
__se_sys_mkdir fs/namei.c:4079 [inline]
__x64_sys_mkdir+0x6a/0x80 fs/namei.c:4079
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f87cfc78219
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 14 00 00 90 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffccf1d2b78 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007f87cfced720 RCX: 00007f87cfc78219
RDX: 00007f87cfc36483 RSI: 0000000000000000 RDI: 0000000020000200
RBP: 0000000000000001 R08: 0000000000000c07 R09: 001c00000000000c
R10: 00007ffccf1d2a40 R11: 0000000000000246 R12: 0000000000000004
R13: 0000000000000003 R14: 00007ffccf1d2b97 R15: 00007ffccf1d2b9a
</TASK>

Allocated by task 3341:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:553 [inline]
kzalloc include/linux/slab.h:689 [inline]
alloc_bprm+0x57/0x700 fs/exec.c:1508
do_execveat_common+0x1b3/0x720 fs/exec.c:1893
do_execve fs/exec.c:2016 [inline]
__do_sys_execve fs/exec.c:2092 [inline]
__se_sys_execve fs/exec.c:2087 [inline]
__x64_sys_execve+0x8e/0xa0 fs/exec.c:2087
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

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

The buggy address belongs to the physical page:
page:ffffea00008b5e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888022d79800 pfn:0x22d78
head:ffffea00008b5e00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012441c80
raw: ffff888022d79800 000000008010000f 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 1550, tgid 1550 (kworker/u4:5), ts 10312954671, free_ts 0
prep_new_page mm/page_alloc.c:2539 [inline]
get_page_from_freelist+0x3573/0x3700 mm/page_alloc.c:4291
__alloc_pages+0x28d/0x7e0 mm/page_alloc.c:5558
alloc_slab_page+0x6a/0x150 mm/slub.c:1794
allocate_slab mm/slub.c:1939 [inline]
new_slab+0x84/0x2d0 mm/slub.c:1992
___slab_alloc+0xa71/0x1080 mm/slub.c:3180
__slab_alloc mm/slub.c:3279 [inline]
slab_alloc_node mm/slub.c:3364 [inline]
__kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
kmalloc_trace+0x26/0x60 mm/slab_common.c:1045
kmalloc include/linux/slab.h:553 [inline]
kzalloc include/linux/slab.h:689 [inline]
alloc_bprm+0x57/0x700 fs/exec.c:1508
kernel_execve+0x92/0xa10 fs/exec.c:1967
call_usermodehelper_exec_async+0x22f/0x370 kernel/umh.c:113
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
page_owner free stack trace missing

Memory state around the buggy address:
ffff888022d79a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888022d79b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888022d79b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff888022d79c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888022d79c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

syzbot

unread,
Mar 20, 2023, 7:11:55 PM3/20/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 8020ae3c051d Linux 5.15.103
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=100400a6c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=f95b212e0ccdd4d1
dashboard link: https://syzkaller.appspot.com/bug?extid=998afeb1be1fed64fd51
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1555ba9ac80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1257ce16c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/6153dfa8dcc0/disk-8020ae3c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2093d52db59f/vmlinux-8020ae3c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/85041d0bd356/Image-8020ae3c.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/f14678fdcade/mount_0.gz

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

loop0: detected capacity change from 0 to 2048
UDF-fs: INFO Mounting volume 'LinuxUDF', timestamp 2022/11/22 14:59 (1000)
==================================================================
BUG: KASAN: slab-out-of-bounds in udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2100
Write of size 4 at addr ffff0000c2aef3f0 by task syz-executor191/4052

CPU: 0 PID: 4052 Comm: syz-executor191 Not tainted 5.15.103-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_store_n_noabort+0x40/0x4c mm/kasan/report_generic.c:325
udf_write_aext+0x4c0/0x668 fs/udf/inode.c:2100
udf_add_entry+0x11e0/0x28b0 fs/udf/namei.c:482
udf_mkdir+0x158/0x7e0 fs/udf/namei.c:681
vfs_mkdir+0x350/0x514 fs/namei.c:3994
do_mkdirat+0x20c/0x610 fs/namei.c:4019
__do_sys_mkdirat fs/namei.c:4034 [inline]
__se_sys_mkdirat fs/namei.c:4032 [inline]
__arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4032
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 4052:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513
__kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522
kasan_kmalloc include/linux/kasan.h:264 [inline]
kmem_cache_alloc_trace+0x248/0x3b4 mm/slub.c:3247
kmalloc include/linux/slab.h:591 [inline]
kmalloc_array include/linux/slab.h:630 [inline]
kcalloc include/linux/slab.h:660 [inline]
udf_process_sequence+0x170/0x3ed4 fs/udf/super.c:1691
udf_load_sequence fs/udf/super.c:1815 [inline]
udf_check_anchor_block+0x310/0x5f8 fs/udf/super.c:1855
udf_scan_anchors+0x134/0x594 fs/udf/super.c:1888
udf_find_anchor fs/udf/super.c:1945 [inline]
udf_load_vrs+0x1b4/0xab8 fs/udf/super.c:2010
udf_fill_super+0x768/0x1a7c fs/udf/super.c:2188
mount_bdev+0x26c/0x368 fs/super.c:1369
udf_mount+0x44/0x58 fs/udf/super.c:122
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1499
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 4052:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
__kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
kasan_slab_free include/linux/kasan.h:230 [inline]
slab_free_hook mm/slub.c:1705 [inline]
slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
slab_free mm/slub.c:3499 [inline]
kfree+0x1b0/0x480 mm/slub.c:4559
udf_process_sequence+0xd20/0x3ed4 fs/udf/super.c:1783
udf_load_sequence fs/udf/super.c:1815 [inline]
udf_check_anchor_block+0x310/0x5f8 fs/udf/super.c:1855
udf_scan_anchors+0x134/0x594 fs/udf/super.c:1888
udf_find_anchor fs/udf/super.c:1945 [inline]
udf_load_vrs+0x1b4/0xab8 fs/udf/super.c:2010
udf_fill_super+0x768/0x1a7c fs/udf/super.c:2188
mount_bdev+0x26c/0x368 fs/super.c:1369
udf_mount+0x44/0x58 fs/udf/super.c:122
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1499
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000c2aef000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 496 bytes to the right of
512-byte region [ffff0000c2aef000, ffff0000c2aef200)
The buggy address belongs to the page:
page:00000000c870da77 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x102aec
head:00000000c870da77 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002600
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000c2aef280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff0000c2aef300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff0000c2aef380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff0000c2aef400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff0000c2aef480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

syzbot

unread,
Sep 24, 2023, 5:06:19 AM9/24/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 00bce6f792caccefa73daeaf9bde82d24d50037f
git tree: upstream
Author: Jan Kara <ja...@suse.cz>
Date: Thu Oct 6 12:22:33 2022 +0000

udf: Convert udf_mkdir() to new directory iteration code

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1495475a680000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages