================================================================== BUG: KASAN: slab-use-after-free in __mutex_waiter_is_first kernel/locking/mutex.c:172 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock_common kernel/locking/mutex.c:664 [inline] BUG: KASAN: slab-use-after-free in __mutex_lock+0x9eb/0xb10 kernel/locking/mutex.c:730 Read of size 8 at addr ffff888073ec2320 by task kworker/1:1/57 CPU: 1 UID: 0 PID: 57 Comm: kworker/1:1 Not tainted 6.14.0-rc6-syzkaller-00016-g0fed89a961ea #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events l2cap_chan_timeout Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xc3/0x670 mm/kasan/report.c:521 kasan_report+0xd9/0x110 mm/kasan/report.c:634 __mutex_waiter_is_first kernel/locking/mutex.c:172 [inline] __mutex_lock_common kernel/locking/mutex.c:664 [inline] __mutex_lock+0x9eb/0xb10 kernel/locking/mutex.c:730 l2cap_chan_timeout+0x6d/0x310 net/bluetooth/l2cap_core.c:417 process_one_work+0x9c5/0x1ba0 kernel/workqueue.c:3238 process_scheduled_works kernel/workqueue.c:3319 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3400 kthread+0x3af/0x750 kernel/kthread.c:464 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 28114: 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:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] l2cap_conn_add.part.0+0x60/0xa60 net/bluetooth/l2cap_core.c:6825 l2cap_conn_add include/net/bluetooth/hci_core.h:1618 [inline] l2cap_chan_connect+0x15e8/0x2010 net/bluetooth/l2cap_core.c:7016 bt_6lowpan_connect net/bluetooth/6lowpan.c:894 [inline] lowpan_control_write+0x3dc/0x730 net/bluetooth/6lowpan.c:1129 full_proxy_write+0x13c/0x200 fs/debugfs/file.c:398 vfs_write+0x24c/0x1150 fs/read_write.c:677 ksys_write+0x12b/0x250 fs/read_write.c:731 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:387 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:412 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 27995: 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:576 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4609 [inline] kfree+0x2c4/0x4d0 mm/slub.c:4757 l2cap_conn_free net/bluetooth/l2cap_core.c:1810 [inline] kref_put include/linux/kref.h:65 [inline] l2cap_conn_put net/bluetooth/l2cap_core.c:1822 [inline] l2cap_conn_del+0x5a0/0x730 net/bluetooth/l2cap_core.c:1802 hci_disconn_cfm include/net/bluetooth/hci_core.h:2069 [inline] hci_conn_hash_flush+0x44a/0x790 net/bluetooth/hci_conn.c:2698 hci_dev_close_sync+0x603/0x11a0 net/bluetooth/hci_sync.c:5197 hci_dev_do_close+0x2e/0x90 net/bluetooth/hci_core.c:482 hci_unregister_dev+0x213/0x620 net/bluetooth/hci_core.c:2677 vhci_release+0x79/0xf0 drivers/bluetooth/hci_vhci.c:664 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __ia32_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 ia32_sys_call+0x1b1c/0x1c20 arch/x86/include/generated/asm/syscalls_32.h:253 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:387 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:412 entry_SYSENTER_compat_after_hwframe+0x84/0x8e The buggy address belongs to the object at ffff888073ec2000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 800 bytes inside of freed 1024-byte region [ffff888073ec2000, ffff888073ec2400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888073ec6800 pfn:0x73ec0 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000240 ffff88801b042dc0 ffffea00015d9610 ffffea000130f010 raw: ffff888073ec6800 0000000000100004 00000000f5000000 0000000000000000 head: 04fff00000000240 ffff88801b042dc0 ffffea00015d9610 ffffea000130f010 head: ffff888073ec6800 0000000000100004 00000000f5000000 0000000000000000 head: 04fff00000000003 ffffea0001cfb001 ffffffffffffffff 0000000000000000 head: ffff888000000008 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 27635, tgid 27635 (syz-executor), ts 1570343762504, free_ts 1569112358701 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x181/0x1b0 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x221/0x2470 mm/page_alloc.c:4740 alloc_pages_mpol+0x1fc/0x540 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2587 [inline] new_slab+0x23d/0x330 mm/slub.c:2640 ___slab_alloc+0xc5d/0x1720 mm/slub.c:3826 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __kmalloc_cache_noprof+0xfa/0x410 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:882 [inline] batadv_hard_if_event+0xb94/0x1640 net/batman-adv/hard-interface.c:970 notifier_call_chain+0xb7/0x410 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x140 net/core/dev.c:2206 call_netdevice_notifiers_extack net/core/dev.c:2244 [inline] call_netdevice_notifiers net/core/dev.c:2258 [inline] register_netdevice+0x17c2/0x1eb0 net/core/dev.c:10978 ipvlan_link_new+0x353/0xbf0 drivers/net/ipvlan/ipvlan_main.c:589 rtnl_newlink_create net/core/rtnetlink.c:3796 [inline] __rtnl_newlink net/core/rtnetlink.c:3907 [inline] rtnl_newlink+0xb95/0x1d60 net/core/rtnetlink.c:4022 rtnetlink_rcv_msg+0x95b/0xea0 net/core/rtnetlink.c:6912 netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2533 page last free pid 27444 tgid 27444 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0x6db/0xfb0 mm/page_alloc.c:2660 vfree+0x174/0x950 mm/vmalloc.c:3383 kcov_put kernel/kcov.c:439 [inline] kcov_put+0x2a/0x40 kernel/kcov.c:435 kcov_close+0xd/0x20 kernel/kcov.c:535 __fput+0x3ff/0xb70 fs/file_table.c:464 task_work_run+0x14e/0x250 kernel/task_work.c:227 exit_task_work include/linux/task_work.h:40 [inline] do_exit+0xad8/0x2d70 kernel/exit.c:938 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 __do_sys_exit_group kernel/exit.c:1098 [inline] __se_sys_exit_group kernel/exit.c:1096 [inline] __ia32_sys_exit_group+0x3e/0x50 kernel/exit.c:1096 ia32_sys_call+0x1b1c/0x1c20 arch/x86/include/generated/asm/syscalls_32.h:253 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:387 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:412 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff888073ec2200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073ec2280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888073ec2300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888073ec2380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073ec2400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================