syzbot


KASAN: slab-out-of-bounds Write in udf_readdir

Status: upstream: reported C repro on 2024/04/15 06:11
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+136740e3b42e006e87fb@syzkaller.appspotmail.com
First crash: 250d, last: 65d
Fix commit to backport (bisect log) :
tree: upstream
commit 1c80afa04db39c98aebea9aabfafa37a208cdfee
Author: Jan Kara <jack@suse.cz>
Date: Wed Oct 5 16:28:33 2022 +0000

  udf: Implement searching for directory entry using new iteration code

[report pending]
  
Bug presence (2)
Date Name Commit Repro Result
2024/05/04 linux-5.15.y (ToT) 284087d4f7d5 C [report] KASAN: slab-out-of-bounds Write in udf_readdir
2024/05/04 upstream (ToT) 7367539ad4b0 C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: slab-out-of-bounds Write in udf_readdir origin:lts-only C done 161 63d 246d 0/3 upstream: reported C repro on 2024/04/19 05:30
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/12/12 19:57 18m retest repro linux-5.15.y OK log
2024/12/12 19:57 1h07m retest repro linux-5.15.y OK log
2024/10/03 13:43 13m retest repro linux-5.15.y report log
2024/10/03 13:43 10m retest repro linux-5.15.y report log
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/06/07 22:59 4h56m fix candidate upstream OK (1) job log

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in udf_readdir+0xcaa/0x2170 fs/udf/dir.c:182
Write of size 149 at addr ffff888076722a6a by task syz.1.890/7458

CPU: 0 PID: 7458 Comm: syz.1.890 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189
 memcpy+0x3c/0x60 mm/kasan/shadow.c:66
 udf_readdir+0xcaa/0x2170 fs/udf/dir.c:182
 iterate_dir+0x224/0x570
 __do_sys_getdents64 fs/readdir.c:369 [inline]
 __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7efef8695ff9
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:00007efef6aed038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007efef884e058 RCX: 00007efef8695ff9
RDX: 0000000000001000 RSI: 0000000020000840 RDI: 0000000000000008
RBP: 00007efef8708296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007efef884e058 R15: 00007ffec6c73e38
 </TASK>

Allocated by task 7458:
 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+0xba/0xf0 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 udf_readdir+0xbc6/0x2170 fs/udf/dir.c:172
 iterate_dir+0x224/0x570
 __do_sys_getdents64 fs/readdir.c:369 [inline]
 __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
 kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:3007 [inline]
 call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3087
 free_fib_info net/ipv4/fib_semantics.c:255 [inline]
 fib_info_put include/net/ip_fib.h:579 [inline]
 fib_release_info+0x61c/0x6e0 net/ipv4/fib_semantics.c:281
 fib_table_flush+0xd14/0x13d0 net/ipv4/fib_trie.c:2091
 fib_flush net/ipv4/fib_frontend.c:194 [inline]
 fib_disable_ip net/ipv4/fib_frontend.c:1415 [inline]
 fib_netdev_event+0x3c5/0x760 net/ipv4/fib_frontend.c:1484
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2018 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2030 [inline]
 call_netdevice_notifiers net/core/dev.c:2044 [inline]
 dev_close_many+0x37c/0x530 net/core/dev.c:1619
 unregister_netdevice_many+0x4b0/0x18f0 net/core/dev.c:11070
 default_device_exit_batch+0x390/0x3f0 net/core/dev.c:11627
 ops_exit_list net/core/net_namespace.c:177 [inline]
 cleanup_net+0x763/0xb60 net/core/net_namespace.c:599
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff888076722a00
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 106 bytes inside of
 256-byte region [ffff888076722a00, ffff888076722b00)
The buggy address belongs to the page:
page:ffffea0001d9c880 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76722
head:ffffea0001d9c880 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888017041b40
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 3687, ts 70460597762, free_ts 70179878572
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 __kmalloc+0x1c9/0x300 mm/slub.c:4403
 kmalloc_array include/linux/slab.h:631 [inline]
 kcalloc include/linux/slab.h:660 [inline]
 __list_lru_init+0xa6/0xa70 mm/list_lru.c:596
 alloc_super+0x7b2/0x940 fs/super.c:274
 sget_fc+0x305/0x730 fs/super.c:552
 vfs_get_super fs/super.c:1165 [inline]
 get_tree_nodev+0x26/0x160 fs/super.c:1200
 fuse_get_tree+0x35a/0x4c0 fs/fuse/inode.c:1753
 vfs_get_tree+0x88/0x270 fs/super.c:1528
 do_new_mount+0x2ba/0xb40 fs/namespace.c:3005
 do_mount fs/namespace.c:3348 [inline]
 __do_sys_mount fs/namespace.c:3556 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3533
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
 do_slab_free mm/slub.c:3487 [inline]
 ___cache_free+0xe3/0x100 mm/slub.c:3506
 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 shmem_alloc_inode+0x16/0x30 mm/shmem.c:3792
 alloc_inode fs/inode.c:236 [inline]
 new_inode_pseudo+0x60/0x210 fs/inode.c:972
 new_inode+0x25/0x1d0 fs/inode.c:1001
 shmem_get_inode+0x327/0xad0 mm/shmem.c:2293
 shmem_mknod+0x54/0x1b0 mm/shmem.c:2853
 shmem_mkdir+0x27/0x60 mm/shmem.c:2906

Memory state around the buggy address:
 ffff888076722980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888076722a00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888076722a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06
                                                                ^
 ffff888076722b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888076722b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (403):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/16 12:32 linux-5.15.y 3a5928702e71 bde2d81c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/10/15 20:45 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/10/15 20:45 linux-5.15.y 3a5928702e71 7eb57b4a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/10/05 00:19 linux-5.15.y 3a5928702e71 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/16 04:39 linux-5.15.y 3a5928702e71 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/14 04:42 linux-5.15.y 3a5928702e71 b58f933c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/11 14:41 linux-5.15.y 14e468424d3e 8ab55d0e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/11 02:05 linux-5.15.y 14e468424d3e 86aa7bd7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/07 20:29 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/07 13:14 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/07 12:06 linux-5.15.y 14e468424d3e 9750182a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/03 02:06 linux-5.15.y fa93fa65db6e 8045124c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/09/02 17:27 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/30 22:03 linux-5.15.y fa93fa65db6e 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/30 12:59 linux-5.15.y fa93fa65db6e ee2602b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/30 12:56 linux-5.15.y fa93fa65db6e ee2602b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/29 06:13 linux-5.15.y fa93fa65db6e ef3de9e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/29 00:35 linux-5.15.y fa93fa65db6e ef3de9e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/28 23:31 linux-5.15.y fa93fa65db6e ef3de9e8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/26 05:51 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/24 14:11 linux-5.15.y fa93fa65db6e d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/18 14:22 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/17 07:34 linux-5.15.y 7e89efd3ae1c dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/15 07:14 linux-5.15.y 7e89efd3ae1c e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/14 02:03 linux-5.15.y 7e89efd3ae1c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/13 18:42 linux-5.15.y 7e89efd3ae1c f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/12 07:19 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/12 06:40 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/11 21:58 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/11 11:38 linux-5.15.y 7e89efd3ae1c 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/08 09:17 linux-5.15.y 7e89efd3ae1c de12cf65 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/07 18:33 linux-5.15.y 7e89efd3ae1c 109d2082 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/04 07:49 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/03 00:39 linux-5.15.y 7e89efd3ae1c 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/02 17:50 linux-5.15.y 7e89efd3ae1c 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/08/02 13:28 linux-5.15.y 7e89efd3ae1c 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/25 06:28 linux-5.15.y 7c6d66f0266f d1a1b0ca .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/25 00:35 linux-5.15.y 7c6d66f0266f d1a1b0ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/14 21:48 linux-5.15.y f45bea23c39c eaeb5c15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/11 17:08 linux-5.15.y f45bea23c39c c699c2eb .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/07 18:44 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/06 22:02 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/06 12:52 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/07/06 09:57 linux-5.15.y f45bea23c39c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/04/15 07:06 linux-5.15.y fa3df276cd36 c8349e48 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/04/15 06:10 linux-5.15.y fa3df276cd36 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in udf_readdir
2024/04/25 06:51 linux-5.15.y c52b9710c83d 8bdc0f22 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Write in udf_readdir
* Struck through repros no longer work on HEAD.