syzbot


KASAN: slab-out-of-bounds Read in search_by_key (2)

Status: upstream: reported on 2022/11/03 15:41
Reported-by: syzbot+b3b14fb9f8a14c5d0267@syzkaller.appspotmail.com
First crash: 26d, last: 42m
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in search_by_key 1 248d 244d 0/24 auto-closed as invalid on 2022/06/23 17:15
upstream KMSAN: uninit-value in search_by_key 1549 748d 799d 17/24 fixed on 2020/11/16 12:12

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in search_by_key+0xf2/0x49c0 fs/reiserfs/stree.c:632
Read of size 8 at addr ffff88802678e3f0 by task syz-executor.4/9639

CPU: 1 PID: 9639 Comm: syz-executor.4 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106
 print_address_description+0x74/0x340 mm/kasan/report.c:284
 print_report+0x107/0x1f0 mm/kasan/report.c:395
 kasan_report+0xcd/0x100 mm/kasan/report.c:495
 search_by_key+0xf2/0x49c0 fs/reiserfs/stree.c:632
 search_by_entry_key+0x36/0xd20 fs/reiserfs/namei.c:125
 reiserfs_readdir_inode+0x235/0x1410 fs/reiserfs/dir.c:98
 iterate_dir+0x257/0x5f0
 __do_sys_getdents fs/readdir.c:286 [inline]
 __se_sys_getdents+0x1db/0x4d0 fs/readdir.c:271
 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:0x7f1f6208b5a9
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1f62e83168 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f1f621abf80 RCX: 00007f1f6208b5a9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f1f620e67b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc33ce425f R14: 00007f1f62e83300 R15: 0000000000022000
 </TASK>

Allocated by task 9639:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x3d/0x60 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:371 [inline]
 __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380
 kmalloc include/linux/slab.h:576 [inline]
 kzalloc include/linux/slab.h:712 [inline]
 bfs_fill_super+0x5a/0xe30 fs/bfs/inode.c:321
 mount_bdev+0x26c/0x3a0 fs/super.c:1400
 legacy_get_tree+0xea/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x289/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d3/0x3c0 fs/namespace.c:3568
 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 ffff88802678e200
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 240 bytes to the right of
 256-byte region [ffff88802678e200, ffff88802678e300)

The buggy address belongs to the physical page:
page:ffffea000099e380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2678e
head:ffffea000099e380 order:1 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00007c1380 dead000000000003 ffff888012041b40
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 34, tgid 34 (kworker/u4:2), ts 195026526707, free_ts 195023823133
 prep_new_page mm/page_alloc.c:2538 [inline]
 get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4287
 __alloc_pages+0x259/0x560 mm/page_alloc.c:5554
 alloc_slab_page+0x70/0xf0 mm/slub.c:1794
 allocate_slab+0x5e/0x4b0 mm/slub.c:1939
 new_slab mm/slub.c:1992 [inline]
 ___slab_alloc+0x782/0xe20 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:954 [inline]
 __kmalloc+0x9e/0x1a0 mm/slab_common.c:968
 kmalloc include/linux/slab.h:581 [inline]
 kzalloc include/linux/slab.h:712 [inline]
 ieee80211_ibss_build_presp+0x116/0x1920 net/mac80211/ibss.c:70
 __ieee80211_sta_join_ibss+0x7b9/0x14b0 net/mac80211/ibss.c:316
 ieee80211_sta_create_ibss+0x35b/0x600 net/mac80211/ibss.c:1348
 ieee80211_sta_find_ibss net/mac80211/ibss.c:1478 [inline]
 ieee80211_ibss_work+0xe9c/0x1540 net/mac80211/ibss.c:1705
 process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
 kthread+0x266/0x300 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1458 [inline]
 free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1508
 free_unref_page_prepare mm/page_alloc.c:3386 [inline]
 free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3482
 free_slab mm/slub.c:2031 [inline]
 discard_slab mm/slub.c:2037 [inline]
 __unfreeze_partials+0x1ab/0x200 mm/slub.c:2586
 put_cpu_partial+0x106/0x170 mm/slub.c:2662
 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:302
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slab.h:737 [inline]
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x1cc/0x300 mm/slub.c:3422
 getname_flags+0xb8/0x4e0 fs/namei.c:139
 user_path_at_empty+0x2a/0x1a0 fs/namei.c:2875
 do_readlinkat+0x10c/0x3d0 fs/stat.c:468
 __do_sys_readlink fs/stat.c:501 [inline]
 __se_sys_readlink fs/stat.c:498 [inline]
 __x64_sys_readlink+0x7b/0x90 fs/stat.c:498
 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

Memory state around the buggy address:
 ffff88802678e280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88802678e300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88802678e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                             ^
 ffff88802678e400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802678e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (119):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-fs 2022/11/03 05:18 upstream b229b6ca5abb 7a2ebf95 .config log report info KASAN: slab-out-of-bounds Read in search_by_key
ci-upstream-kmsan-gce-386 2022/11/29 11:44 https://github.com/google/kmsan.git master 49a9a20768f5 ca9683b8 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/29 06:33 https://github.com/google/kmsan.git master 49a9a20768f5 ca9683b8 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 19:34 https://github.com/google/kmsan.git master 49a9a20768f5 247de55b .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 18:30 https://github.com/google/kmsan.git master 49a9a20768f5 247de55b .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 10:26 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 08:36 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 05:32 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/28 00:35 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 21:48 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 19:32 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 13:56 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 11:45 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 05:29 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 04:09 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 02:30 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/27 00:56 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 21:27 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 16:07 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 10:33 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 07:00 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 03:50 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 01:48 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/26 00:16 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 22:37 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 21:23 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 18:47 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 12:51 https://github.com/google/kmsan.git master a472f15b3d1e 74a66371 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 00:51 https://github.com/google/kmsan.git master e889f323ec44 62e26685 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/25 00:05 https://github.com/google/kmsan.git master e889f323ec44 62e26685 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/24 11:48 https://github.com/google/kmsan.git master ddce02aa9c40 12c66417 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/24 04:23 https://github.com/google/kmsan.git master ddce02aa9c40 12c66417 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/23 16:10 https://github.com/google/kmsan.git master ddce02aa9c40 75740b3f .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/23 03:38 https://github.com/google/kmsan.git master ddce02aa9c40 9da37ae8 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/23 03:38 https://github.com/google/kmsan.git master ddce02aa9c40 9da37ae8 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/23 03:38 https://github.com/google/kmsan.git master ddce02aa9c40 9da37ae8 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 09:06 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 08:58 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 08:57 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 08:54 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 08:44 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 06:40 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:54 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:53 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:46 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:38 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:20 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 05:00 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 04:55 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
ci-upstream-kmsan-gce-386 2022/11/22 04:34 https://github.com/google/kmsan.git master 6b3059a0a074 1c576c23 .config log report info KMSAN: uninit-value in search_by_key
* Struck through repros no longer work on HEAD.