syzbot


KASAN: use-after-free Read in ax25_addr_ax25dev

Status: upstream: reported on 2025/01/31 08:06
Reported-by: syzbot+1de283b57bc195a3107b@syzkaller.appspotmail.com
First crash: 225d, last: 12d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ax25_addr_ax25dev+0x55/0x160 net/ax25/ax25_dev.c:38
Read of size 8 at addr ffff8880197c3d08 by task syz.2.369/5904

CPU: 0 PID: 5904 Comm: syz.2.369 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 ax25_addr_ax25dev+0x55/0x160 net/ax25/ax25_dev.c:38
 ax25_fwd_ioctl+0x1c/0x4b0 net/ax25/ax25_dev.c:148
 ax25_ioctl+0x8fe/0xb70 net/ax25/af_ax25.c:1889
 sock_do_ioctl+0xd3/0x2f0 net/socket.c:1140
 sock_ioctl+0x4ed/0x6e0 net/socket.c:1257
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f46c29bfbe9
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:00007f46c0c27038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f46c2bf6fa0 RCX: 00007f46c29bfbe9
RDX: 0000200000000340 RSI: 00000000000089eb RDI: 0000000000000006
RBP: 00007f46c2a42e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f46c2bf7038 R14: 00007f46c2bf6fa0 R15: 00007fff1d016968
 </TASK>

Allocated by task 5805:
 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 mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522
 kmalloc_node include/linux/slab.h:622 [inline]
 kzalloc_node include/linux/slab.h:746 [inline]
 alloc_worker kernel/workqueue.c:1861 [inline]
 init_rescuer+0x91/0x290 kernel/workqueue.c:4288
 alloc_workqueue+0xe98/0x13f0 kernel/workqueue.c:4368
 ocfs2_initialize_super fs/ocfs2/super.c:2310 [inline]
 ocfs2_fill_super+0x3f3b/0x4d80 fs/ocfs2/super.c:995
 mount_bdev+0x287/0x3c0 fs/super.c:1400
 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1530
 do_new_mount+0x24a/0xa40 fs/namespace.c:3025
 do_mount fs/namespace.c:3368 [inline]
 __do_sys_mount fs/namespace.c:3576 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3553
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4185:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4559
 destroy_workqueue+0xfa/0xb20 kernel/workqueue.c:4452
 ocfs2_delete_osb+0x49/0x180 fs/ocfs2/super.c:2509
 ocfs2_dismount_volume+0x557/0x880 fs/ocfs2/super.c:1944
 generic_shutdown_super+0x130/0x300 fs/super.c:475
 kill_block_super+0x7c/0xe0 fs/super.c:1427
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1139
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 insert_work+0x54/0x3d0 kernel/workqueue.c:1366
 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559
 queue_work include/linux/workqueue.h:512 [inline]
 loop_queue_work drivers/block/loop.c:1068 [inline]
 loop_queue_rq+0x9d8/0xac0 drivers/block/loop.c:2202
 __blk_mq_issue_directly block/blk-mq.c:2014 [inline]
 __blk_mq_try_issue_directly+0x497/0x810 block/blk-mq.c:2070
 blk_mq_request_issue_directly block/blk-mq.c:2118 [inline]
 blk_mq_try_issue_list_directly+0x1a1/0x530 block/blk-mq.c:2136
 blk_mq_sched_insert_requests+0x2d6/0x5c0 block/blk-mq-sched.c:512
 blk_mq_flush_plug_list+0x57f/0x660 block/blk-mq.c:1971
 blk_flush_plug_list+0x3ec/0x430 block/blk-core.c:1734
 blk_finish_plug+0x59/0x80 block/blk-core.c:1751
 generic_writepages+0x102/0x160 mm/page-writeback.c:2369
 do_writepages+0x48d/0x6d0 mm/page-writeback.c:2386
 filemap_fdatawrite_wbc+0x1eb/0x240 mm/filemap.c:400
 __filemap_fdatawrite_range mm/filemap.c:433 [inline]
 filemap_write_and_wait_range+0xfa/0x380 mm/filemap.c:704
 kill_block_super+0x84/0xe0 fs/super.c:1428
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1139
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Second to last potentially related work creation:
 kasan_save_stack+0x35/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348
 insert_work+0x54/0x3d0 kernel/workqueue.c:1366
 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532
 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559
 queue_work include/linux/workqueue.h:512 [inline]
 loop_queue_work drivers/block/loop.c:1068 [inline]
 loop_queue_rq+0x9d8/0xac0 drivers/block/loop.c:2202
 __blk_mq_issue_directly block/blk-mq.c:2014 [inline]
 __blk_mq_try_issue_directly+0x497/0x810 block/blk-mq.c:2070
 blk_mq_request_issue_directly block/blk-mq.c:2118 [inline]
 blk_mq_try_issue_list_directly+0x1a1/0x530 block/blk-mq.c:2136
 blk_mq_sched_insert_requests+0x2d6/0x5c0 block/blk-mq-sched.c:512
 blk_mq_flush_plug_list+0x57f/0x660 block/blk-mq.c:1971
 blk_flush_plug_list+0x3ec/0x430 block/blk-core.c:1734
 blk_finish_plug+0x59/0x80 block/blk-core.c:1751
 generic_writepages+0x102/0x160 mm/page-writeback.c:2369
 do_writepages+0x48d/0x6d0 mm/page-writeback.c:2386
 filemap_fdatawrite_wbc+0x1eb/0x240 mm/filemap.c:400
 __filemap_fdatawrite_range mm/filemap.c:433 [inline]
 __filemap_fdatawrite mm/filemap.c:439 [inline]
 filemap_flush+0xb3/0x100 mm/filemap.c:466
 sync_filesystem+0x141/0x220 fs/sync.c:60
 generic_shutdown_super+0x6b/0x300 fs/super.c:448
 kill_block_super+0x7c/0xe0 fs/super.c:1427
 deactivate_locked_super+0x93/0xf0 fs/super.c:335
 cleanup_mnt+0x418/0x4d0 fs/namespace.c:1139
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

The buggy address belongs to the object at ffff8880197c3d00
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 8 bytes inside of
 192-byte region [ffff8880197c3d00, ffff8880197c3dc0)
The buggy address belongs to the page:
page:ffffea000065f0c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880197c3a00 pfn:0x197c3
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea00006ebe40 0000000600000006 ffff888016841a00
raw: ffff8880197c3a00 000000008010000f 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 2515556646, free_ts 0
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x81e/0xdf0 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_track_caller+0x1cb/0x330 mm/slub.c:4925
 __do_krealloc mm/slab_common.c:1244 [inline]
 krealloc+0x5a/0xf0 mm/slab_common.c:1277
 add_sysfs_param+0xe8/0x930 kernel/params.c:651
 kernel_add_sysfs_param+0xaf/0x120 kernel/params.c:812
 param_sysfs_builtin+0x164/0x1e0 kernel/params.c:851
 param_sysfs_init+0x66/0x70 kernel/params.c:972
 do_one_initcall+0x1ee/0x680 init/main.c:1302
 do_initcall_level+0x137/0x1f0 init/main.c:1375
 do_initcalls+0x4b/0x90 init/main.c:1391
 kernel_init_freeable+0x3ce/0x560 init/main.c:1615
 kernel_init+0x19/0x1b0 init/main.c:1506
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8880197c3c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880197c3c80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880197c3d00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8880197c3d80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880197c3e00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/01 12:18 linux-5.15.y 01879f56bdde 807a3b61 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_addr_ax25dev
2025/08/29 03:28 linux-5.15.y 01879f56bdde d401b9d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_addr_ax25dev
2025/06/07 12:56 linux-5.15.y 1c700860e8bc 4826c28e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_addr_ax25dev
2025/05/27 12:05 linux-5.15.y 98f47d0e9b8c 874a1386 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/05/23 04:38 linux-5.15.y 98f47d0e9b8c fa44301a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/03/31 04:40 linux-5.15.y 0c935c049b5c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/02/22 03:25 linux-5.15.y c16c81c81336 d34966d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/01/31 08:06 linux-5.15.y 003148680b79 4c6ac32f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/01/31 08:06 linux-5.15.y 003148680b79 4c6ac32f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_addr_ax25dev
2025/01/31 08:40 linux-5.15.y 003148680b79 4c6ac32f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 BUG: unable to handle kernel paging request in ax25_addr_ax25dev
* Struck through repros no longer work on HEAD.