syzbot


KASAN: slab-use-after-free Read in rose_get_neigh

Status: upstream: reported on 2024/06/11 06:56
Subsystems: hams
[Documentation on labels]
Reported-by: syzbot+e04e2c007ba2c80476cb@syzkaller.appspotmail.com
First crash: 152d, last: 14d
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly hams report (Aug 2024) 0 (1) 2024/08/13 08:52
[syzbot] Monthly hams report (Jun 2024) 0 (1) 2024/06/11 13:40
[syzbot] [hams?] KASAN: slab-use-after-free Read in rose_get_neigh 0 (1) 2024/06/11 06:56
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in rose_get_neigh 1 64d 64d 0/3 upstream: reported on 2024/07/31 20:40

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in rose_get_neigh+0x549/0x640 net/rose/rose_route.c:692
Read of size 1 at addr ffff88803b55f030 by task syz.3.8368/30691

CPU: 0 UID: 0 PID: 30691 Comm: syz.3.8368 Not tainted 6.11.0-rc1-syzkaller-00062-ge4fc196f5ba3 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:119
 print_address_description mm/kasan/report.c:377 [inline]
 print_report+0xc3/0x620 mm/kasan/report.c:488
 kasan_report+0xd9/0x110 mm/kasan/report.c:601
 rose_get_neigh+0x549/0x640 net/rose/rose_route.c:692
 rose_connect+0x2d2/0x1500 net/rose/af_rose.c:808
 __sys_connect_file+0x15f/0x1a0 net/socket.c:2061
 __sys_connect+0x149/0x170 net/socket.c:2078
 __do_sys_connect net/socket.c:2088 [inline]
 __se_sys_connect net/socket.c:2085 [inline]
 __x64_sys_connect+0x72/0xb0 net/socket.c:2085
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fbdc2f773b9
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:00007fbdc3d54048 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 00007fbdc3105f80 RCX: 00007fbdc2f773b9
RDX: 000000000000001c RSI: 00000000200006c0 RDI: 0000000000000004
RBP: 00007fbdc2fe48e6 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007fbdc3105f80 R15: 00007fff5c31e668
 </TASK>

Allocated by task 26519:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
 kmalloc_noprof include/linux/slab.h:681 [inline]
 kzalloc_noprof include/linux/slab.h:807 [inline]
 tomoyo_find_next_domain+0x102/0x2020 security/tomoyo/domain.c:710
 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:102 [inline]
 tomoyo_bprm_check_security+0x12e/0x1d0 security/tomoyo/tomoyo.c:92
 security_bprm_check+0x65/0xb0 security/security.c:1191
 search_binary_handler fs/exec.c:1809 [inline]
 exec_binprm fs/exec.c:1863 [inline]
 bprm_execve fs/exec.c:1914 [inline]
 bprm_execve+0x642/0x1960 fs/exec.c:1890
 kernel_execve+0x2ef/0x3b0 fs/exec.c:2081
 call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:110
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Freed by task 26519:
 kasan_save_stack+0x33/0x60 mm/kasan/common.c:47
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579
 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240
 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256
 kasan_slab_free include/linux/kasan.h:184 [inline]
 slab_free_hook mm/slub.c:2252 [inline]
 slab_free mm/slub.c:4473 [inline]
 kfree+0x12a/0x3b0 mm/slub.c:4594
 tomoyo_find_next_domain+0x785/0x2020 security/tomoyo/domain.c:882
 tomoyo_bprm_check_security security/tomoyo/tomoyo.c:102 [inline]
 tomoyo_bprm_check_security+0x12e/0x1d0 security/tomoyo/tomoyo.c:92
 security_bprm_check+0x65/0xb0 security/security.c:1191
 search_binary_handler fs/exec.c:1809 [inline]
 exec_binprm fs/exec.c:1863 [inline]
 bprm_execve fs/exec.c:1914 [inline]
 bprm_execve+0x642/0x1960 fs/exec.c:1890
 kernel_execve+0x2ef/0x3b0 fs/exec.c:2081
 call_usermodehelper_exec_async+0x255/0x4c0 kernel/umh.c:110
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

The buggy address belongs to the object at ffff88803b55f000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 48 bytes inside of
 freed 512-byte region [ffff88803b55f000, ffff88803b55f200)

The buggy address belongs to the physical page:
page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88803b55d000 pfn:0x3b55c
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xfdffffff(slab)
raw: 00fff00000000240 ffff888015842c80 ffffea0000a2e610 ffffea000083df10
raw: ffff88803b55d000 0000000000100009 00000001fdffffff 0000000000000000
head: 00fff00000000240 ffff888015842c80 ffffea0000a2e610 ffffea000083df10
head: ffff88803b55d000 0000000000100009 00000001fdffffff 0000000000000000
head: 00fff00000000002 ffffea0000ed5701 ffffffffffffffff 0000000000000000
head: 0000000700000004 0000000000000000 00000000ffffffff 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 4823, tgid 4823 (udevd), ts 91305192031, free_ts 91295467551
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1493
 prep_new_page mm/page_alloc.c:1501 [inline]
 get_page_from_freelist+0x1351/0x2e50 mm/page_alloc.c:3442
 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4700
 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline]
 alloc_pages_node_noprof include/linux/gfp.h:296 [inline]
 alloc_slab_page+0x4e/0xf0 mm/slub.c:2321
 allocate_slab mm/slub.c:2484 [inline]
 new_slab+0x84/0x260 mm/slub.c:2537
 ___slab_alloc+0xdac/0x1870 mm/slub.c:3723
 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3813
 __slab_alloc_node mm/slub.c:3866 [inline]
 slab_alloc_node mm/slub.c:4025 [inline]
 __kmalloc_cache_noprof+0x2b4/0x300 mm/slub.c:4184
 kmalloc_noprof include/linux/slab.h:681 [inline]
 kzalloc_noprof include/linux/slab.h:807 [inline]
 kernfs_fop_open+0x28b/0xdb0 fs/kernfs/file.c:623
 do_dentry_open+0x91f/0x15f0 fs/open.c:959
 vfs_open+0x82/0x3f0 fs/open.c:1089
 do_open fs/namei.c:3727 [inline]
 path_openat+0x2141/0x2d20 fs/namei.c:3886
 do_filp_open+0x1dc/0x430 fs/namei.c:3913
 do_sys_openat2+0x17a/0x1e0 fs/open.c:1416
 do_sys_open fs/open.c:1431 [inline]
 __do_sys_openat fs/open.c:1447 [inline]
 __se_sys_openat fs/open.c:1442 [inline]
 __x64_sys_openat+0x175/0x210 fs/open.c:1442
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
page last free pid 5346 tgid 5346 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1094 [inline]
 free_unref_page+0x64a/0xe40 mm/page_alloc.c:2612
 stack_depot_save_flags+0x2da/0x8f0 lib/stackdepot.c:666
 kasan_save_stack+0x42/0x60 mm/kasan/common.c:48
 kasan_save_track+0x14/0x30 mm/kasan/common.c:68
 poison_kmalloc_redzone mm/kasan/common.c:370 [inline]
 __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:387
 kmalloc_noprof include/linux/slab.h:681 [inline]
 kzalloc_noprof include/linux/slab.h:807 [inline]
 kobject_uevent_env+0x265/0x1860 lib/kobject_uevent.c:540
 device_del+0x623/0x9f0 drivers/base/core.c:3886
 rfkill_unregister+0xd0/0x2c0 net/rfkill/core.c:1147
 hci_unregister_dev+0x323/0x620 net/bluetooth/hci_core.c:2716
 vhci_release+0x7f/0x100 drivers/bluetooth/hci_vhci.c:666
 __fput+0x408/0xbb0 fs/file_table.c:422
 task_work_run+0x14e/0x250 kernel/task_work.c:228
 exit_task_work include/linux/task_work.h:40 [inline]
 do_exit+0xaa3/0x2bb0 kernel/exit.c:882
 do_group_exit+0xd3/0x2a0 kernel/exit.c:1031
 get_signal+0x25fd/0x2770 kernel/signal.c:2917
 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:310

Memory state around the buggy address:
 ffff88803b55ef00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88803b55ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88803b55f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
 ffff88803b55f080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88803b55f100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (26):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/31 21:07 upstream e4fc196f5ba3 1e9c4cf3 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/28 12:31 net 301927d2d2eb 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/01 06:57 net 134061163ee5 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/30 17:11 net 134061163ee5 757f06b1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/20 03:39 net be27b8965297 41b7e219 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/09/19 16:02 net-next 9410645520e9 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/13 13:40 net-next 0a3e6939d4b3 f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/13 13:26 net-next 0a3e6939d4b3 f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/13 13:20 net-next 0a3e6939d4b3 f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/13 13:20 net-next 0a3e6939d4b3 f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/13 13:19 net-next 0a3e6939d4b3 f21a18ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/08/07 14:38 net-next 2c14119ab8f3 7b2f2f35 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/31 20:11 net-next 990c30493013 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/31 20:03 net-next 990c30493013 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/31 20:03 net-next 990c30493013 1e9c4cf3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/26 14:29 net-next 1722389b0d86 3f86dfed .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/07/17 07:10 net-next 77ae5e5b0072 215bec2d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/27 21:01 net-next cce346d44139 b62c7d46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/13 14:35 net-next 3ec8d7572a69 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/13 14:08 net-next 3ec8d7572a69 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/13 11:29 net-next 91579c93a9b2 2aa5052f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/11 06:55 net-next bb678f01804c 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/06/03 14:16 net-next 93e30878f7ec 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/05/18 05:56 net-next 1b294a1f3561 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/05/10 18:54 net-next 383eed2de529 f7c35481 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
2024/05/04 15:29 net-next 173e7622ccb3 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce KASAN: slab-use-after-free Read in rose_get_neigh
* Struck through repros no longer work on HEAD.