Bluetooth: hci0: command tx timeout ================================================================== BUG: KASAN: stack-out-of-bounds in skb_put_data include/linux/skbuff.h:2800 [inline] BUG: KASAN: stack-out-of-bounds in l2cap_build_cmd net/bluetooth/l2cap_core.c:3003 [inline] BUG: KASAN: stack-out-of-bounds in l2cap_send_cmd+0x2a3/0xb90 net/bluetooth/l2cap_core.c:954 Read of size 20 at addr ffffc9000f80f4e0 by task kworker/u5:2/5302 CPU: 0 UID: 0 PID: 5302 Comm: kworker/u5:2 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: hci0 hci_rx_work Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x264/0x2c0 mm/kasan/generic.c:200 __asan_memcpy+0x29/0x70 mm/kasan/shadow.c:105 skb_put_data include/linux/skbuff.h:2800 [inline] l2cap_build_cmd net/bluetooth/l2cap_core.c:3003 [inline] l2cap_send_cmd+0x2a3/0xb90 net/bluetooth/l2cap_core.c:954 l2cap_ecred_conn_req net/bluetooth/l2cap_core.c:5208 [inline] l2cap_le_sig_cmd net/bluetooth/l2cap_core.c:5510 [inline] l2cap_le_sig_channel net/bluetooth/l2cap_core.c:5568 [inline] l2cap_recv_frame+0xc032/0x10240 net/bluetooth/l2cap_core.c:6913 l2cap_recv_acldata+0x7e9/0x13e0 net/bluetooth/l2cap_core.c:7637 hci_acldata_packet net/bluetooth/hci_core.c:3855 [inline] hci_rx_work+0x4f9/0x1030 net/bluetooth/hci_core.c:4082 process_one_work kernel/workqueue.c:3276 [inline] process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359 worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440 kthread+0x388/0x470 kernel/kthread.c:436 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to stack of task kworker/u5:2/5302 and is located at offset 128 in frame: l2cap_recv_frame+0x0/0x10240 include/linux/skbuff.h:-1 This frame has 26 objects: [32, 34) 'rsp.i241.i.i' [48, 88) 'chan.i.i.i' [128, 146) 'pdu_u.i.i.i' [192, 202) 'rsp.i94.i.i' [224, 226) 'rsp.i.i.i111' [240, 242) 'rej.i' [256, 258) 'rej.i145.i' [272, 274) 'rej.i143.i' [288, 290) 'req.i229.i.i' [304, 312) 'buf.i222.i.i' [336, 348) 'buf29.i.i.i' [368, 372) 'rsp49.i.i.i' [384, 393) 'rfc.i.i118.i.i' [416, 480) 'buf.i119.i.i' [512, 576) 'req.i120.i.i' [608, 617) 'rfc.i.i.i.i' [640, 656) 'efs.i.i.i.i' [672, 678) 'rej.i371.i.i.i' [704, 710) 'rej.i.i.i.i' [736, 800) 'rsp.i.i.i' [832, 896) 'buf.i.i.i' [928, 1056) 'req.i.i.i' [1088, 1096) 'rsp.i.i.i.i' [1120, 1122) 'info.i.i.i.i' [1136, 1264) 'buf.i.i.i.i' [1296, 1298) 'rej.i.i' The buggy address belongs to a 8-page vmalloc region starting at 0xffffc9000f808000 allocated at copy_process+0x508/0x3cd0 kernel/fork.c:2050 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f5a7 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 0000000000000000 ffffea00007d69c8 0000000000000000 raw: 0000000000000000 0000000000000000 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 0x29c2(GFP_NOWAIT|__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_ZERO), pid 2, tgid 2 (kthreadd), ts 81404387614, free_ts 64724739773 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 __alloc_pages_noprof+0xa/0x30 mm/page_alloc.c:5284 __alloc_pages_node_noprof include/linux/gfp.h:289 [inline] alloc_pages_node_noprof include/linux/gfp.h:316 [inline] vm_area_alloc_pages mm/vmalloc.c:3664 [inline] __vmalloc_area_node mm/vmalloc.c:3876 [inline] __vmalloc_node_range_noprof+0x7be/0x1730 mm/vmalloc.c:4064 __vmalloc_node_noprof+0xc2/0x100 mm/vmalloc.c:4124 alloc_thread_stack_node kernel/fork.c:355 [inline] dup_task_struct+0x275/0x9a0 kernel/fork.c:924 copy_process+0x508/0x3cd0 kernel/fork.c:2050 kernel_clone+0x248/0x8e0 kernel/fork.c:2653 kernel_thread+0x13f/0x1b0 kernel/fork.c:2714 create_kthread kernel/kthread.c:459 [inline] kthreadd+0x4ec/0x6e0 kernel/kthread.c:817 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 5233 tgid 5233 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 __slab_free+0x263/0x2b0 mm/slub.c:5573 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x97/0x100 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4538 [inline] slab_alloc_node mm/slub.c:4866 [inline] kmem_cache_alloc_noprof+0x2bc/0x650 mm/slub.c:4873 vm_area_alloc+0x24/0x140 mm/vma_init.c:32 __mmap_new_vma mm/vma.c:2517 [inline] __mmap_region mm/vma.c:2759 [inline] mmap_region+0x10eb/0x2240 mm/vma.c:2837 do_mmap+0xc39/0x10c0 mm/mmap.c:559 vm_mmap_pgoff+0x2c9/0x4f0 mm/util.c:581 ksys_mmap_pgoff+0x51e/0x760 mm/mmap.c:605 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffffc9000f80f380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffc9000f80f400: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 >ffffc9000f80f480: f8 f2 f8 f8 f8 f8 f8 f2 f2 f2 f2 f2 00 00 02 f2 ^ ffffc9000f80f500: f2 f2 f2 f2 f8 f8 f2 f2 f8 f2 f8 f2 f8 f2 f8 f2 ffffc9000f80f580: f8 f2 f8 f2 f2 f2 f8 f8 f2 f2 f8 f2 f8 f8 f2 f2 ==================================================================