================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 Read of size 8 at addr ffff888014e37868 by task kworker/u19:5/3735 CPU: 2 PID: 3735 Comm: kworker/u19:5 Not tainted 6.0.0-rc6-syzkaller-00030-g06f7db949993 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: hci3 hci_error_reset 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_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3595: 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 kmalloc_reserve net/core/skbuff.c:362 [inline] pskb_expand_head+0x203/0x1110 net/core/skbuff.c:1729 skb_ensure_writable net/core/skbuff.c:5638 [inline] skb_ensure_writable+0x2c7/0x450 net/core/skbuff.c:5630 __bpf_try_make_writable net/core/filter.c:1656 [inline] bpf_try_make_writable net/core/filter.c:1662 [inline] bpf_try_make_head_writable net/core/filter.c:1670 [inline] ____bpf_clone_redirect net/core/filter.c:2424 [inline] bpf_clone_redirect+0x125/0x420 net/core/filter.c:2402 ___bpf_prog_run+0x369d/0x7960 kernel/bpf/core.c:1813 __bpf_prog_run512+0x91/0xd0 kernel/bpf/core.c:2038 bpf_dispatcher_nop_func include/linux/bpf.h:903 [inline] __bpf_prog_run include/linux/filter.h:594 [inline] bpf_prog_run include/linux/filter.h:601 [inline] bpf_test_run+0x37c/0x9c0 net/bpf/test_run.c:402 bpf_prog_test_run_skb+0xbab/0x1e60 net/bpf/test_run.c:1141 bpf_prog_test_run kernel/bpf/syscall.c:3620 [inline] __sys_bpf+0x185e/0x6130 kernel/bpf/syscall.c:4971 __do_sys_bpf kernel/bpf/syscall.c:5057 [inline] __se_sys_bpf kernel/bpf/syscall.c:5055 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:5055 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 Freed by task 3595: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x13d/0x1a0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3418 [inline] kfree+0x173/0x390 mm/slab.c:3786 skb_free_head+0xac/0x110 net/core/skbuff.c:662 skb_release_data+0x5f1/0x870 net/core/skbuff.c:691 skb_release_all net/core/skbuff.c:756 [inline] __kfree_skb net/core/skbuff.c:770 [inline] kfree_skb_reason.part.0+0xdd/0x320 net/core/skbuff.c:792 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1206 [inline] ____dev_forward_skb include/linux/netdevice.h:3935 [inline] __dev_forward_skb2+0x30a/0x7c0 net/core/dev.c:2137 dev_forward_skb_nomtu+0x1b/0x60 net/core/dev.c:2179 __bpf_rx_skb net/core/filter.c:2085 [inline] __bpf_redirect_common net/core/filter.c:2154 [inline] __bpf_redirect+0x21f/0xe30 net/core/filter.c:2161 ____bpf_clone_redirect net/core/filter.c:2430 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2402 ___bpf_prog_run+0x369d/0x7960 kernel/bpf/core.c:1813 __bpf_prog_run512+0x91/0xd0 kernel/bpf/core.c:2038 bpf_dispatcher_nop_func include/linux/bpf.h:903 [inline] __bpf_prog_run include/linux/filter.h:594 [inline] bpf_prog_run include/linux/filter.h:601 [inline] bpf_test_run+0x37c/0x9c0 net/bpf/test_run.c:402 bpf_prog_test_run_skb+0xbab/0x1e60 net/bpf/test_run.c:1141 bpf_prog_test_run kernel/bpf/syscall.c:3620 [inline] __sys_bpf+0x185e/0x6130 kernel/bpf/syscall.c:4971 __do_sys_bpf kernel/bpf/syscall.c:5057 [inline] __se_sys_bpf kernel/bpf/syscall.c:5055 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:5055 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 The buggy address belongs to the object at ffff888014e37800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 104 bytes inside of 512-byte region [ffff888014e37800, ffff888014e37a00) The buggy address belongs to the physical page: page:ffffea0000538dc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x14e37 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000539888 ffffea00009a1808 ffff888011840600 raw: 0000000000000000 ffff888014e37000 0000000100000004 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 0x2c2220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3647, tgid 3647 (sshd), ts 65414484793, free_ts 62701388602 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages_slowpath.constprop.0+0x2d7/0x2240 mm/page_alloc.c:5058 __alloc_pages+0x43d/0x510 mm/page_alloc.c:5528 __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] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 __napi_alloc_skb+0x93/0x340 net/core/skbuff.c:575 napi_alloc_skb include/linux/skbuff.h:3207 [inline] e1000_alloc_rx_skb drivers/net/ethernet/intel/e1000/e1000_main.c:4112 [inline] e1000_copybreak drivers/net/ethernet/intel/e1000/e1000_main.c:4331 [inline] e1000_clean_rx_irq+0x6ff/0x1080 drivers/net/ethernet/intel/e1000/e1000_main.c:4383 e1000_clean+0x961/0x1c40 drivers/net/ethernet/intel/e1000/e1000_main.c:3803 __napi_poll+0xb3/0x6d0 net/core/dev.c:6511 napi_poll net/core/dev.c:6578 [inline] net_rx_action+0x9c1/0xd90 net/core/dev.c:6689 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 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 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3389 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3452 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slab.c:3232 [inline] kmem_cache_alloc_node+0x2f1/0x560 mm/slab.c:3583 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:422 alloc_skb_fclone include/linux/skbuff.h:1307 [inline] tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:861 tcp_sendmsg_locked+0xc36/0x2f80 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1483 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 sock_write_iter+0x291/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:578 Memory state around the buggy address: ffff888014e37700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888014e37780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888014e37800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888014e37880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888014e37900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================