================================================================== BUG: KASAN: use-after-free in ax25_fillin_cb_from_dev net/ax25/af_ax25.c:468 [inline] BUG: KASAN: use-after-free in ax25_fillin_cb+0x394/0x568 net/ax25/af_ax25.c:495 Read of size 4 at addr ffff0000d2c66038 by task syz.0.18/4172 CPU: 1 PID: 4172 Comm: syz.0.18 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x78/0x30c mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xec/0x15c mm/kasan/report.c:451 __asan_report_load4_noabort+0x44/0x50 mm/kasan/report_generic.c:308 ax25_fillin_cb_from_dev net/ax25/af_ax25.c:468 [inline] ax25_fillin_cb+0x394/0x568 net/ax25/af_ax25.c:495 ax25_setsockopt+0x8d0/0xa5c net/ax25/af_ax25.c:690 __sys_setsockopt+0x260/0x36c net/socket.c:2203 __do_sys_setsockopt net/socket.c:2214 [inline] __se_sys_setsockopt net/socket.c:2211 [inline] __arm64_sys_setsockopt+0xb8/0xd4 net/socket.c:2211 __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+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Allocated by task 4170: 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+0xb0/0xf0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x274/0x3fc mm/slub.c:3247 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] ax25_dev_device_up+0x5c/0x540 net/ax25/ax25_dev.c:55 ax25_device_event+0x504/0x590 net/ax25/af_ax25.c:139 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2049 [inline] call_netdevice_notifiers_extack net/core/dev.c:2061 [inline] call_netdevice_notifiers net/core/dev.c:2075 [inline] __dev_notify_flags+0x250/0x46c net/core/dev.c:-1 dev_change_flags+0xc8/0x154 net/core/dev.c:8929 dev_ifsioc+0x504/0xef4 net/core/dev_ioctl.c:324 dev_ioctl+0x4d0/0xc94 net/core/dev_ioctl.c:587 sock_do_ioctl+0x18c/0x240 net/socket.c:1154 sock_ioctl+0x5c8/0x87c net/socket.c:1257 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:860 __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+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 4171: 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/0x1e8 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x170/0x40c mm/slub.c:4559 ax25_dev_put include/net/ax25.h:302 [inline] ax25_release+0x564/0x814 net/ax25/af_ax25.c:1062 __sock_release net/socket.c:649 [inline] sock_close+0xb4/0x1f8 net/socket.c:1336 __fput+0x1c0/0x7f8 fs/file_table.c:311 ____fput+0x20/0x30 fs/file_table.c:339 task_work_run+0x12c/0x1e0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x24b4/0x3128 arch/arm64/kernel/signal.c:949 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xcc/0x114 mm/kasan/generic.c:348 insert_work+0x64/0x388 kernel/workqueue.c:1366 __queue_work+0xb30/0x1054 kernel/workqueue.c:1532 queue_work_on+0xc4/0x17c kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] call_usermodehelper_exec+0x22c/0x478 kernel/umh.c:435 kobject_uevent_env+0x670/0x888 lib/kobject_uevent.c:633 kobject_uevent+0x2c/0x3c lib/kobject_uevent.c:657 device_add+0xa28/0xf94 drivers/base/core.c:3393 device_create_groups_vargs+0x1d4/0x26c drivers/base/core.c:4096 device_create+0xe8/0x134 drivers/base/core.c:4138 sound_insert_unit+0x6c0/0x720 sound/sound_core.c:283 register_sound_special_device+0x304/0x3a8 sound/sound_core.c:411 snd_register_oss_device+0x2d4/0x448 sound/core/sound_oss.c:123 snd_mixer_oss_notify_handler+0x164/0xce4 sound/core/oss/mixer_oss.c:1382 snd_card_register+0x49c/0x620 sound/core/init.c:932 snd_virmidi_probe+0x3b0/0x5c4 sound/drivers/virmidi.c:108 platform_probe+0x13c/0x1b4 drivers/base/platform.c:1391 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26c/0xaec drivers/base/dd.c:595 __driver_probe_device+0x180/0x314 drivers/base/dd.c:755 driver_probe_device+0x78/0x34c drivers/base/dd.c:785 __device_attach_driver+0x274/0x4c4 drivers/base/dd.c:907 bus_for_each_drv+0x150/0x1d8 drivers/base/bus.c:429 __device_attach+0x2a8/0x3d4 drivers/base/dd.c:979 device_initial_probe+0x24/0x34 drivers/base/dd.c:1028 bus_probe_device+0xbc/0x1c4 drivers/base/bus.c:489 device_add+0xb04/0xf94 drivers/base/core.c:3412 platform_device_add+0x3f8/0x6ec drivers/base/platform.c:712 platform_device_register_full+0x4f8/0x618 drivers/base/platform.c:835 platform_device_register_resndata include/linux/platform_device.h:141 [inline] platform_device_register_simple include/linux/platform_device.h:170 [inline] alsa_card_virmidi_init+0x124/0x244 sound/drivers/virmidi.c:148 do_one_initcall+0x228/0x8b0 init/main.c:1302 do_initcall_level+0x154/0x214 init/main.c:1375 do_initcalls+0x58/0xac init/main.c:1391 do_basic_setup+0x8c/0xa0 init/main.c:1410 kernel_init_freeable+0x404/0x5fc init/main.c:1615 kernel_init+0x24/0x1d0 init/main.c:1506 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:855 The buggy address belongs to the object at ffff0000d2c66000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 56 bytes inside of 256-byte region [ffff0000d2c66000, ffff0000d2c66100) The buggy address belongs to the page: page:0000000031468f8b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x112c66 head:0000000031468f8b order:1 compound_mapcount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 dead000000000100 dead000000000122 ffff0000c0002480 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d2c65f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d2c65f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d2c66000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d2c66080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d2c66100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Unable to handle kernel paging request at virtual address 00000312000015f3 Mem abort info: ESR = 0x0000000096000021 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x21: alignment fault Data abort info: ISV = 0, ISS = 0x00000021 CM = 0, WnR = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=000000012d525000 [00000312000015f3] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 0000000096000021 [#1] PREEMPT SMP Modules linked in: CPU: 1 PID: 4172 Comm: syz.0.18 Tainted: G B 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __lse_atomic_fetch_sub_release arch/arm64/include/asm/atomic_lse.h:161 [inline] pc : arch_atomic_fetch_sub_release arch/arm64/include/asm/atomic.h:51 [inline] pc : atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:168 [inline] pc : __refcount_dec include/linux/refcount.h:338 [inline] pc : refcount_dec include/linux/refcount.h:359 [inline] pc : dev_put include/linux/netdevice.h:4197 [inline] pc : ax25_release+0x4f4/0x814 net/ax25/af_ax25.c:1061 lr : __lse_atomic_fetch_sub_release arch/arm64/include/asm/atomic_lse.h:161 [inline] lr : arch_atomic_fetch_sub_release arch/arm64/include/asm/atomic.h:51 [inline] lr : atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:168 [inline] lr : __refcount_dec include/linux/refcount.h:338 [inline] lr : refcount_dec include/linux/refcount.h:359 [inline] lr : dev_put include/linux/netdevice.h:4197 [inline] lr : ax25_release+0x4ec/0x814 net/ax25/af_ax25.c:1061 sp : ffff80001fd67a00 x29: ffff80001fd67a20 x28: dfff800000000000 x27: ffff0000d769f080 x26: ffff0000d5052028 x25: 0000000000000002 x24: 00000000ffffffff x23: ed000312000015f3 x22: ffff0000d2c66000 x21: ffff0000dcf3e018 x20: ffff0000d769f000 x19: 1fffe0001aa0a405 x18: 0000000000000000 x17: 0000000000000000 x16: ffff8000082d6448 x15: 0000000000000002 x14: 0000000000ff0100 x13: ffffffffffffffff x12: 0000000000ff0100 x11: 0000000000000000 x10: 0000000000000000 x9 : ffff80001045ef30 x8 : ffff0000c0f88000 x7 : 0000000000000000 x6 : ffff80000837b9bc x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80001045ef24 x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000001 Call trace: __lse_atomic_fetch_sub_release arch/arm64/include/asm/atomic_lse.h:161 [inline] arch_atomic_fetch_sub_release arch/arm64/include/asm/atomic.h:51 [inline] atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:168 [inline] __refcount_dec include/linux/refcount.h:338 [inline] refcount_dec include/linux/refcount.h:359 [inline] dev_put include/linux/netdevice.h:4197 [inline] ax25_release+0x4f4/0x814 net/ax25/af_ax25.c:1061 __sock_release net/socket.c:649 [inline] sock_close+0xb4/0x1f8 net/socket.c:1336 __fput+0x1c0/0x7f8 fs/file_table.c:311 ____fput+0x20/0x30 fs/file_table.c:339 task_work_run+0x12c/0x1e0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x24b4/0x3128 arch/arm64/kernel/signal.c:949 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xf0/0x1e0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Code: d503201f 96006935 52800038 4b1803f8 (b87802f8) ---[ end trace 7494e79bc122d1b7 ]--- ---------------- Code disassembly (best guess): 0: d503201f nop 4: 96006935 bl 0xfffffffff801a4d8 8: 52800038 mov w24, #0x1 // #1 c: 4b1803f8 neg w24, w24 * 10: b87802f8 ldaddl w24, w24, [x23] <-- trapping instruction