syzbot


KASAN: use-after-free Read in ax25_unregister_dev_sysctl

Status: upstream: reported on 2025/05/21 17:30
Reported-by: syzbot+5a18a7a7d20f1f24ef2e@syzkaller.appspotmail.com
First crash: 210d, last: 52d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ax25_unregister_dev_sysctl+0x33/0xa0 net/ax25/sysctl_net_ax25.c:172
Read of size 8 at addr ffff888022b8ec18 by task syz.1.1312/8522

CPU: 0 PID: 8522 Comm: syz.1.1312 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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_unregister_dev_sysctl+0x33/0xa0 net/ax25/sysctl_net_ax25.c:172
 ax25_dev_device_down+0x5b/0x520 net/ax25/ax25_dev.c:101
 ax25_device_event+0x4b4/0x4f0 net/ax25/af_ax25.c:144
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 dev_close_many+0x28d/0x400 net/core/dev.c:1650
 dev_close+0x14c/0x200 net/core/dev.c:1672
 bpq_device_event+0x2f4/0x9c0 drivers/net/hamradio/bpqether.c:548
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 dev_close_many+0x28d/0x400 net/core/dev.c:1650
 dev_close+0x14c/0x200 net/core/dev.c:1672
 bond_setup_by_slave+0x61/0x3a0 drivers/net/bonding/bond_main.c:1471
 bond_enslave+0x77c/0x3a40 drivers/net/bonding/bond_main.c:1855
 bond_do_ioctl+0x2a2/0x8c0 drivers/net/bonding/bond_main.c:4238
 bond_siocdevprivate+0x13c/0x320 drivers/net/bonding/bond_main.c:-1
 dev_siocdevprivate net/core/dev_ioctl.c:285 [inline]
 dev_ifsioc+0xaf5/0xe70 net/core/dev_ioctl.c:403
 dev_ioctl+0x5f9/0xe50 net/core/dev_ioctl.c:612
 sock_ioctl+0x67b/0x6e0 net/socket.c:1184
 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:0x7fd4c2e19fc9
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:00007fd4c103f038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd4c3071180 RCX: 00007fd4c2e19fc9
RDX: 0000200000000180 RSI: 00000000000089f0 RDI: 0000000000000008
RBP: 00007fd4c2e9cf91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd4c3071218 R14: 00007fd4c3071180 R15: 00007fff5ffdc368
 </TASK>

Allocated by task 7899:
 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 include/linux/slab.h:607 [inline]
 addr_event+0xc3/0x460 drivers/infiniband/core/roce_gid_mgmt.c:840
 inet6addr_event+0x9c/0xc0 drivers/infiniband/core/roce_gid_mgmt.c:883
 notifier_call_chain kernel/notifier.c:83 [inline]
 atomic_notifier_call_chain+0x15d/0x280 kernel/notifier.c:198
 ipv6_add_addr+0xb30/0xde0 net/ipv6/addrconf.c:1182
 addrconf_add_linklocal+0x280/0x6b0 net/ipv6/addrconf.c:3238
 addrconf_addr_gen+0x4ee/0x620 net/ipv6/addrconf.c:3369
 addrconf_init_auto_addrs+0x6d5/0xa80 net/ipv6/addrconf.c:-1
 addrconf_notify+0xa6b/0xf00 net/ipv6/addrconf.c:3662
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 __dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1
 dev_change_flags+0xe3/0x1a0 net/core/dev.c:8929
 dev_ifsioc+0x147/0xe70 net/core/dev_ioctl.c:324
 dev_ioctl+0x55f/0xe50 net/core/dev_ioctl.c:587
 sock_do_ioctl+0x222/0x2f0 net/socket.c:1154
 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

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
 inet6addr_event+0x9c/0xc0 drivers/infiniband/core/roce_gid_mgmt.c:883
 notifier_call_chain kernel/notifier.c:83 [inline]
 atomic_notifier_call_chain+0x15d/0x280 kernel/notifier.c:198
 ipv6_add_addr+0xb30/0xde0 net/ipv6/addrconf.c:1182
 addrconf_add_linklocal+0x280/0x6b0 net/ipv6/addrconf.c:3238
 addrconf_addr_gen+0x4ee/0x620 net/ipv6/addrconf.c:3369
 addrconf_init_auto_addrs+0x6d5/0xa80 net/ipv6/addrconf.c:-1
 addrconf_notify+0xa6b/0xf00 net/ipv6/addrconf.c:3662
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers net/core/dev.c:2075 [inline]
 __dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1
 dev_change_flags+0xe3/0x1a0 net/core/dev.c:8929
 dev_ifsioc+0x147/0xe70 net/core/dev_ioctl.c:324
 dev_ioctl+0x55f/0xe50 net/core/dev_ioctl.c:587
 sock_do_ioctl+0x222/0x2f0 net/socket.c:1154
 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

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
 inetaddr_event+0xe0/0x140 drivers/infiniband/core/roce_gid_mgmt.c:869
 notifier_call_chain kernel/notifier.c:83 [inline]
 blocking_notifier_call_chain+0x103/0x1b0 kernel/notifier.c:318
 __inet_insert_ifa+0x9e9/0xbc0 net/ipv4/devinet.c:567
 inet_rtm_newaddr+0x940/0x1800 net/ipv4/devinet.c:966
 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2507
 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
 netlink_unicast+0x774/0x920 net/netlink/af_netlink.c:1344
 netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1918
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x423/0x580 net/socket.c:2063
 __do_sys_sendto net/socket.c:2075 [inline]
 __se_sys_sendto net/socket.c:2071 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2071
 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

The buggy address belongs to the object at ffff888022b8ec00
 which belongs to the cache kmalloc-192 of size 192
The buggy address is located 24 bytes inside of
 192-byte region [ffff888022b8ec00, ffff888022b8ecc0)
The buggy address belongs to the page:
page:ffffea00008ae380 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888022b8ef00 pfn:0x22b8e
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 ffffea0000930e88 ffffea00009566c8 ffff888016841a00
raw: ffff888022b8ef00 0000000000100008 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 10721772607, free_ts 9005366326
 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:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 __kmalloc+0x1cd/0x330 mm/slub.c:4408
 kmalloc include/linux/slab.h:612 [inline]
 usb_alloc_urb+0x3f/0x140 drivers/usb/core/urb.c:74
 usb_internal_control_msg drivers/usb/core/message.c:95 [inline]
 usb_control_msg+0x115/0x3e0 drivers/usb/core/message.c:153
 usb_get_status+0xe3/0x290 drivers/usb/core/message.c:1147
 usb_get_std_status include/linux/usb.h:1834 [inline]
 hub_configure drivers/usb/core/hub.c:1612 [inline]
 hub_probe+0x1cb8/0x35e0 drivers/usb/core/hub.c:1951
 usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x284/0xc80 drivers/base/dd.c:595
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
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+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page+0x94/0x280 mm/page_alloc.c:3396
 __vunmap+0x8ab/0xa40 mm/vmalloc.c:2628
 free_work+0x56/0x80 mm/vmalloc.c:95
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff888022b8eb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888022b8eb80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888022b8ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff888022b8ec80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff888022b8ed00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/26 13:06 linux-5.15.y ac56c046adf4 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_unregister_dev_sysctl
2025/10/26 13:06 linux-5.15.y ac56c046adf4 c0460fcd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_unregister_dev_sysctl
2025/05/21 17:30 linux-5.15.y a68c15152131 dc5d3808 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in ax25_unregister_dev_sysctl
2025/07/23 01:01 linux-5.15.y c79648372d02 8e9d1dc1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in ax25_unregister_dev_sysctl
* Struck through repros no longer work on HEAD.