================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] BUG: KASAN: slab-use-after-free in __refcount_add include/linux/refcount.h:184 [inline] BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:241 [inline] BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:258 [inline] BUG: KASAN: slab-use-after-free in sock_hold include/net/sock.h:774 [inline] BUG: KASAN: slab-use-after-free in sco_conn_del+0xb9/0x2d0 net/bluetooth/sco.c:195 Write of size 4 at addr ffff888026abc080 by task syz-executor.3/7448 CPU: 1 PID: 7448 Comm: syz-executor.3 Not tainted 6.9.0-rc3-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:114 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 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] __refcount_add include/linux/refcount.h:184 [inline] __refcount_inc include/linux/refcount.h:241 [inline] refcount_inc include/linux/refcount.h:258 [inline] sock_hold include/net/sock.h:774 [inline] sco_conn_del+0xb9/0x2d0 net/bluetooth/sco.c:195 sco_disconn_cfm+0x76/0xb0 net/bluetooth/sco.c:1372 hci_disconn_cfm include/net/bluetooth/hci_core.h:2022 [inline] hci_conn_hash_flush+0x114/0x260 net/bluetooth/hci_conn.c:2566 hci_dev_close_sync+0x53e/0x12b0 net/bluetooth/hci_sync.c:5159 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x1eb/0x600 net/bluetooth/hci_core.c:2773 vhci_release+0x7f/0x100 drivers/bluetooth/hci_vhci.c:674 __fput+0x270/0xb80 fs/file_table.c:422 task_work_run+0x14e/0x250 kernel/task_work.c:180 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xa7d/0x2c10 kernel/exit.c:878 do_group_exit+0xd3/0x2a0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __ia32_sys_exit_group+0x3e/0x50 kernel/exit.c:1036 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7f/0x89 RIP: 0023:0xf734c579 Code: Unable to access opcode bytes at 0xf734c54f. RSP: 002b:00000000ffcc3e2c EFLAGS: 00000282 ORIG_RAX: 00000000000000fc RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000ffcc3f30 RDX: 00000000f7378167 RSI: 0000000000000000 RDI: 00000000f73f31b5 RBP: 00000000ffcc3e88 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7498: 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 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slub.c:3966 [inline] __kmalloc_node_track_caller+0x220/0x470 mm/slub.c:3986 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599 pskb_expand_head+0x236/0x1130 net/core/skbuff.c:2245 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1317 netlink_broadcast_filtered+0xc7/0xf10 net/netlink/af_netlink.c:1523 nlmsg_multicast_filtered include/net/netlink.h:1111 [inline] nlmsg_multicast include/net/netlink.h:1130 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2602 rtnl_notify net/core/rtnetlink.c:757 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4078 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4094 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4081 [inline] rtnetlink_event+0x177/0x1f0 net/core/rtnetlink.c:6646 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 __netdev_upper_dev_link+0x43d/0x850 net/core/dev.c:7797 netdev_master_upper_dev_link+0xa0/0xd0 net/core/dev.c:7867 batadv_hardif_enable_interface+0x28e/0xd30 net/batman-adv/hard-interface.c:734 batadv_softif_slave_add+0xf6/0x140 net/batman-adv/soft-interface.c:844 do_set_master+0x1bc/0x230 net/core/rtnetlink.c:2685 do_setlink+0xa74/0x3ea0 net/core/rtnetlink.c:2891 __rtnl_newlink+0xc3a/0x1960 net/core/rtnetlink.c:3680 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x3c7/0xe60 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x47f/0x4e0 net/socket.c:2191 __do_compat_sys_socketcall+0x5e2/0x700 net/compat.c:475 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7f/0x89 Freed by task 7498: 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 mm/kasan/common.c:240 [inline] __kasan_slab_free+0x11d/0x1a0 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kfree+0x129/0x390 mm/slub.c:4390 skb_kfree_head net/core/skbuff.c:1096 [inline] skb_free_head+0x110/0x1e0 net/core/skbuff.c:1108 skb_release_data+0x76c/0x990 net/core/skbuff.c:1136 skb_release_all net/core/skbuff.c:1202 [inline] __kfree_skb net/core/skbuff.c:1216 [inline] consume_skb net/core/skbuff.c:1432 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1426 netlink_broadcast_filtered+0x3d5/0xf10 net/netlink/af_netlink.c:1546 nlmsg_multicast_filtered include/net/netlink.h:1111 [inline] nlmsg_multicast include/net/netlink.h:1130 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2602 rtnl_notify net/core/rtnetlink.c:757 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4078 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4094 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4081 [inline] rtnetlink_event+0x177/0x1f0 net/core/rtnetlink.c:6646 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 __netdev_upper_dev_link+0x43d/0x850 net/core/dev.c:7797 netdev_master_upper_dev_link+0xa0/0xd0 net/core/dev.c:7867 batadv_hardif_enable_interface+0x28e/0xd30 net/batman-adv/hard-interface.c:734 batadv_softif_slave_add+0xf6/0x140 net/batman-adv/soft-interface.c:844 do_set_master+0x1bc/0x230 net/core/rtnetlink.c:2685 do_setlink+0xa74/0x3ea0 net/core/rtnetlink.c:2891 __rtnl_newlink+0xc3a/0x1960 net/core/rtnetlink.c:3680 rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3727 rtnetlink_rcv_msg+0x3c7/0xe60 net/core/rtnetlink.c:6595 netlink_rcv_skb+0x165/0x410 net/netlink/af_netlink.c:2559 netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline] netlink_unicast+0x542/0x820 net/netlink/af_netlink.c:1361 netlink_sendmsg+0x8b8/0xd70 net/netlink/af_netlink.c:1905 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] __sys_sendto+0x47f/0x4e0 net/socket.c:2191 __do_compat_sys_socketcall+0x5e2/0x700 net/compat.c:475 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x7a/0x120 arch/x86/entry/common.c:321 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:346 entry_SYSENTER_compat_after_hwframe+0x7f/0x89 The buggy address belongs to the object at ffff888026abc000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff888026abc000, ffff888026abc800) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26ab8 head: order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888014c42f00 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 head: 00fff80000000840 ffff888014c42f00 0000000000000000 dead000000000001 head: 0000000000000000 0000000000080008 00000001ffffffff 0000000000000000 head: 00fff80000000003 ffffea00009aae01 ffffea00009aae48 00000000ffffffff head: 0000000800000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5243, tgid 5243 (kworker/0:3), ts 1284437344918, free_ts 1280856102925 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1534 prep_new_page mm/page_alloc.c:1541 [inline] get_page_from_freelist+0xa28/0x3780 mm/page_alloc.c:3317 __alloc_pages+0x22b/0x2460 mm/page_alloc.c:4575 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2175 [inline] allocate_slab mm/slub.c:2338 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2391 ___slab_alloc+0x670/0x16d0 mm/slub.c:3525 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3610 __slab_alloc_node mm/slub.c:3663 [inline] slab_alloc_node mm/slub.c:3835 [inline] __do_kmalloc_node mm/slub.c:3965 [inline] __kmalloc_node_track_caller+0x367/0x470 mm/slub.c:3986 kmalloc_reserve+0xef/0x2c0 net/core/skbuff.c:599 pskb_expand_head+0x236/0x1130 net/core/skbuff.c:2245 netlink_trim+0x1ef/0x250 net/netlink/af_netlink.c:1317 netlink_broadcast_filtered+0xc7/0xf10 net/netlink/af_netlink.c:1523 nlmsg_multicast_filtered include/net/netlink.h:1111 [inline] nlmsg_multicast include/net/netlink.h:1130 [inline] nlmsg_notify+0x9e/0x220 net/netlink/af_netlink.c:2602 rtnl_notify net/core/rtnetlink.c:757 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:4078 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4094 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:4081 [inline] rtnetlink_event+0x177/0x1f0 net/core/rtnetlink.c:6646 notifier_call_chain+0xb9/0x410 kernel/notifier.c:93 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:1950 netdev_lower_state_changed+0xb8/0x150 net/core/dev.c:8440 page last free pid 5246 tgid 5246 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1141 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2347 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2487 __put_partials+0x14c/0x170 mm/slub.c:2906 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmalloc_trace+0x147/0x330 mm/slub.c:3992 kmalloc include/linux/slab.h:628 [inline] kzalloc include/linux/slab.h:749 [inline] nsim_fib6_rt_create drivers/net/netdevsim/fib.c:547 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:752 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:856 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline] nsim_fib_event_work+0x154f/0x31a0 drivers/net/netdevsim/fib.c:1492 process_one_work+0x902/0x1a30 kernel/workqueue.c:3254 process_scheduled_works kernel/workqueue.c:3335 [inline] worker_thread+0x6c8/0xf70 kernel/workqueue.c:3416 kthread+0x2c1/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:243 Memory state around the buggy address: ffff888026abbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888026abc000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888026abc080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888026abc100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888026abc180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================