================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 Read of size 8 at addr ffff888015304c68 by task syz-executor.3/3717 CPU: 3 PID: 3717 Comm: syz-executor.3 Not tainted 6.0.0-rc6-syzkaller-00281-g1707c39ae309 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [inline] klist_release+0x66/0x480 lib/klist.c:189 kref_put include/linux/kref.h:65 [inline] klist_dec_and_del lib/klist.c:206 [inline] klist_put+0x151/0x1d0 lib/klist.c:217 device_del+0x243/0xc80 drivers/base/core.c:3683 hci_conn_del_sysfs+0xdc/0x180 net/bluetooth/hci_sysfs.c:78 hci_conn_cleanup+0x315/0x7b0 net/bluetooth/hci_conn.c:147 hci_conn_del+0x29b/0x790 net/bluetooth/hci_conn.c:1022 hci_conn_hash_flush+0x197/0x260 net/bluetooth/hci_conn.c:2367 hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_unregister_dev+0x17f/0x4e0 net/bluetooth/hci_core.c:2682 vhci_release+0x7c/0xf0 drivers/bluetooth/hci_vhci.c:568 __fput+0x277/0x9d0 fs/file_table.c:320 task_work_run+0xdd/0x1a0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0xad5/0x29b0 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:934 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f088c68a669 Code: Unable to access opcode bytes at RIP 0x7f088c68a63f. RSP: 002b:00007ffd51427198 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00007ffd51427a20 RCX: 00007f088c68a669 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000043 RBP: 0000000000000000 R08: 0000000000000026 R09: 00007ffd51427a20 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f088c6d47f0 R13: 0000000000000002 R14: 0000000000000004 R15: 00007ffd51427a60 Allocated by task 3132: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:525 kasan_kmalloc include/linux/kasan.h:234 [inline] kmem_cache_alloc_trace+0x25a/0x460 mm/slab.c:3559 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] kernfs_fop_open+0x2fa/0xfd0 fs/kernfs/file.c:680 do_dentry_open+0x4a4/0x13a0 fs/open.c:880 do_open fs/namei.c:3557 [inline] path_openat+0x1c92/0x28f0 fs/namei.c:3691 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1313 do_sys_open fs/open.c:1329 [inline] __do_sys_openat fs/open.c:1345 [inline] __se_sys_openat fs/open.c:1340 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x625/0x1210 kernel/workqueue.c:1517 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0x7e/0x90 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x625/0x1210 kernel/workqueue.c:1517 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 The buggy address belongs to the object at ffff888015304c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 104 bytes inside of 512-byte region [ffff888015304c00, ffff888015304e00) The buggy address belongs to the physical page: page:ffffea000054c100 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888015304000 pfn:0x15304 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000086c708 ffffea000088b648 ffff888011840600 raw: ffff888015304000 ffff888015304000 0000000100000003 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1479, tgid 1479 (kworker/u17:0), ts 14634287698, free_ts 14625554038 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3246 [inline] slab_alloc mm/slab.c:3287 [inline] kmem_cache_alloc_trace+0x362/0x460 mm/slab.c:3557 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] alloc_bprm+0x51/0x900 fs/exec.c:1507 kernel_execve+0xab/0x500 fs/exec.c:1967 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 mm_free_pgd kernel/fork.c:737 [inline] __mmdrop+0xcb/0x3f0 kernel/fork.c:788 mmdrop include/linux/sched/mm.h:50 [inline] __mmput+0x3f1/0x4b0 kernel/fork.c:1197 mmput+0x56/0x60 kernel/fork.c:1208 free_bprm+0x65/0x2e0 fs/exec.c:1485 kernel_execve+0x3fa/0x500 fs/exec.c:2004 call_usermodehelper_exec_async+0x2e3/0x580 kernel/umh.c:112 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff888015304b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888015304b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888015304c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888015304c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888015304d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================