================================================================== BUG: KASAN: use-after-free in ex_handler_refcount+0x164/0x1a0 arch/x86/mm/extable.c:49 Write of size 4 at addr ffff8880a91a9498 by task syz-executor.3/30289 CPU: 0 PID: 30289 Comm: syz-executor.3 Not tainted 4.14.193-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_store4_noabort+0x68/0x70 mm/kasan/report.c:434 ex_handler_refcount+0x164/0x1a0 arch/x86/mm/extable.c:49 fixup_exception+0x8a/0xc3 arch/x86/mm/extable.c:197 do_trap_no_signal arch/x86/kernel/traps.c:208 [inline] do_trap+0x61/0x250 arch/x86/kernel/traps.c:257 do_error_trap+0x132/0x2d0 arch/x86/kernel/traps.c:301 invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:964 RIP: 0010:inat_get_avx_attribute+0x52f2/0x6a9a RSP: 0018:ffff888042e4f988 EFLAGS: 00010296 RAX: 0000000000040000 RBX: ffff888051382380 RCX: ffff8880a91a9498 RDX: 0000000000040000 RSI: ffffffff85b5f970 RDI: ffff8880a91a9480 RBP: ffff8880a91a9480 R08: 0000000000000000 R09: 0000000000000004 R10: 0000000000000000 R11: ffff888094e86200 R12: ffff888051382380 R13: ffff8880584926d0 R14: ffffffff850efc94 R15: ffff888054056f88 l2cap_sock_destruct+0x47/0xf0 net/bluetooth/l2cap_sock.c:1489 __sk_destruct+0x49/0x6e0 net/core/sock.c:1557 sk_destruct net/core/sock.c:1597 [inline] __sk_free+0xd9/0x2d0 net/core/sock.c:1605 sock_wfree+0xf3/0x130 net/core/sock.c:1818 skb_release_head_state+0x11e/0x250 net/core/skbuff.c:616 skb_release_all net/core/skbuff.c:629 [inline] __kfree_skb net/core/skbuff.c:645 [inline] kfree_skb+0xae/0x390 net/core/skbuff.c:663 skb_queue_purge+0x14/0x30 net/core/skbuff.c:2855 hci_chan_del+0x11c/0x180 net/bluetooth/hci_conn.c:1561 l2cap_conn_del+0x417/0x670 net/bluetooth/l2cap_core.c:1736 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7435 [inline] l2cap_disconn_cfm+0x6b/0x80 net/bluetooth/l2cap_core.c:7428 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline] hci_conn_hash_flush+0x114/0x220 net/bluetooth/hci_conn.c:1376 hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620 hci_rfkill_set_block net/bluetooth/hci_core.c:2050 [inline] hci_rfkill_set_block+0x94/0xe0 net/bluetooth/hci_core.c:2037 rfkill_set_block+0x1b2/0x4a0 net/rfkill/core.c:337 rfkill_fop_write+0x1b6/0x3c0 net/rfkill/core.c:1233 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45d239 RSP: 002b:00007fccfd290c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00000000000383c0 RCX: 000000000045d239 RDX: 0000000000000008 RSI: 0000000020000080 RDI: 0000000000000005 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007fff3f71602f R14: 00007fccfd2919c0 R15: 000000000118cf4c Allocated by task 12204: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] l2cap_chan_create+0x3e/0x3c0 net/bluetooth/l2cap_core.c:441 l2cap_sock_alloc.constprop.0+0x16c/0x210 net/bluetooth/l2cap_sock.c:1606 l2cap_sock_create+0xdd/0x170 net/bluetooth/l2cap_sock.c:1637 bt_sock_create+0x13b/0x280 net/bluetooth/af_bluetooth.c:130 __sock_create+0x303/0x620 net/socket.c:1275 sock_create net/socket.c:1315 [inline] SYSC_socket net/socket.c:1345 [inline] SyS_socket+0xd1/0x1b0 net/socket.c:1325 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 30289: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 l2cap_chan_destroy net/bluetooth/l2cap_core.c:479 [inline] kref_put include/linux/kref.h:70 [inline] l2cap_chan_put+0x152/0x1b0 net/bluetooth/l2cap_core.c:493 l2cap_sock_kill.part.0+0x33/0x70 net/bluetooth/l2cap_sock.c:1054 l2cap_sock_kill net/bluetooth/l2cap_sock.c:1313 [inline] l2cap_sock_close_cb+0x94/0xb0 net/bluetooth/l2cap_sock.c:1312 l2cap_conn_del+0x3a3/0x670 net/bluetooth/l2cap_core.c:1730 l2cap_disconn_cfm net/bluetooth/l2cap_core.c:7435 [inline] l2cap_disconn_cfm+0x6b/0x80 net/bluetooth/l2cap_core.c:7428 hci_disconn_cfm include/net/bluetooth/hci_core.h:1226 [inline] hci_conn_hash_flush+0x114/0x220 net/bluetooth/hci_conn.c:1376 hci_dev_do_close+0x542/0xc50 net/bluetooth/hci_core.c:1620 hci_rfkill_set_block net/bluetooth/hci_core.c:2050 [inline] hci_rfkill_set_block+0x94/0xe0 net/bluetooth/hci_core.c:2037 rfkill_set_block+0x1b2/0x4a0 net/rfkill/core.c:337 rfkill_fop_write+0x1b6/0x3c0 net/rfkill/core.c:1233 __vfs_write+0xe4/0x630 fs/read_write.c:480 vfs_write+0x17f/0x4d0 fs/read_write.c:544 SYSC_write fs/read_write.c:590 [inline] SyS_write+0xf2/0x210 fs/read_write.c:582 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880a91a9480 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff8880a91a9480, ffff8880a91a9c80) The buggy address belongs to the page: page:ffffea0002a46a00 count:1 mapcount:0 mapping:ffff8880a91a8380 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a91a8380 0000000000000000 0000000100000003 raw: ffffea00026085a0 ffffea000152c420 ffff88812fe52c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a91a9380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a91a9400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a91a9480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a91a9500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a91a9580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================