================================================================== BUG: KASAN: use-after-free in ex_handler_refcount+0x18f/0x1c0 arch/x86/mm/extable.c:49 Write of size 4 at addr ffff8880ae2413d8 by task syz-executor762/8130 CPU: 0 PID: 8130 Comm: syz-executor762 Not tainted 4.19.187-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_store4_noabort+0x88/0x90 mm/kasan/report.c:437 ex_handler_refcount+0x18f/0x1c0 arch/x86/mm/extable.c:49 fixup_exception+0x8a/0xd0 arch/x86/mm/extable.c:197 do_trap_no_signal arch/x86/kernel/traps.c:209 [inline] do_trap+0x61/0x250 arch/x86/kernel/traps.c:258 do_error_trap+0x15d/0x310 arch/x86/kernel/traps.c:303 invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:1038 RIP: 0010:__noinstr_text_end+0x7617/0x77e7 Code: 8d 0e 0f 0b 48 8d 8d 80 00 00 00 0f 0b 48 8d 8d 80 00 00 00 0f 0b 48 8d 8b 80 00 00 00 0f 0b 49 8d 4c 24 18 0f 0b 48 8d 4d 18 <0f> 0b 49 8d 8d 80 00 00 00 0f 0b 49 8d 4d 00 0f 0b 48 8d 8b e4 00 RSP: 0018:ffff8880950afbc0 EFLAGS: 00010297 RAX: ffff888095cda2c0 RBX: 0000000000000004 RCX: ffff8880ae2413d8 RDX: 0000000000000000 RSI: ffffffff87dcb8f8 RDI: ffff8880ae2413c0 RBP: ffff8880ae2413c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888095335680 R13: ffff888095335680 R14: ffff8880ae2413c0 R15: ffff8880b5bc3e20 llcp_sock_destruct+0x7b/0x140 net/nfc/llcp_sock.c:959 __sk_destruct+0x4b/0x8a0 net/core/sock.c:1559 sk_destruct net/core/sock.c:1599 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1610 sk_free+0x3b/0x50 net/core/sock.c:1621 sock_put include/net/sock.h:1711 [inline] llcp_sock_release+0x37a/0x520 net/nfc/llcp_sock.c:656 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 __do_sys_exit_group kernel/exit.c:978 [inline] __se_sys_exit_group kernel/exit.c:976 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x43e989 Code: 00 49 c7 c0 c0 ff ff ff be e7 00 00 00 ba 3c 00 00 00 eb 12 0f 1f 44 00 00 89 d0 0f 05 48 3d 00 f0 ff ff 77 1c f4 89 f0 0f 05 <48> 3d 00 f0 ff ff 76 e7 f7 d8 64 41 89 00 eb df 0f 1f 80 00 00 00 RSP: 002b:00007ffef4b14b68 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 00000000004b02f0 RCX: 000000000043e989 RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000000 RBP: 0000000000000000 R08: ffffffffffffffc0 R09: 0000000000000001 R10: 0000000000080800 R11: 0000000000000246 R12: 00000000004b02f0 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001 Allocated by task 1: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] nfc_llcp_register_device+0x45/0x9b0 net/nfc/llcp_core.c:1584 nfc_register_device+0x6d/0x360 net/nfc/core.c:1129 nfcsim_device_new+0x333/0x5af drivers/nfc/nfcsim.c:417 nfcsim_init+0x71/0x14d drivers/nfc/nfcsim.c:464 do_one_initcall+0xf1/0x740 init/main.c:884 do_initcall_level init/main.c:952 [inline] do_initcalls init/main.c:960 [inline] do_basic_setup init/main.c:978 [inline] kernel_init_freeable+0x9a6/0xa98 init/main.c:1145 kernel_init+0xd/0x1b6 init/main.c:1062 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 8132: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 local_release net/nfc/llcp_core.c:187 [inline] kref_put include/linux/kref.h:70 [inline] nfc_llcp_local_put+0x155/0x1b0 net/nfc/llcp_core.c:195 llcp_sock_destruct+0x7b/0x140 net/nfc/llcp_sock.c:959 __sk_destruct+0x4b/0x8a0 net/core/sock.c:1559 sk_destruct net/core/sock.c:1599 [inline] __sk_free+0x165/0x3b0 net/core/sock.c:1610 sk_free+0x3b/0x50 net/core/sock.c:1621 sock_put include/net/sock.h:1711 [inline] llcp_sock_release+0x37a/0x520 net/nfc/llcp_sock.c:656 __sock_release+0xcd/0x2a0 net/socket.c:579 sock_close+0x15/0x20 net/socket.c:1140 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xbf3/0x2be0 kernel/exit.c:870 do_group_exit+0x125/0x310 kernel/exit.c:967 __do_sys_exit_group kernel/exit.c:978 [inline] __se_sys_exit_group kernel/exit.c:976 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880ae2413c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 24 bytes inside of 2048-byte region [ffff8880ae2413c0, ffff8880ae241bc0) The buggy address belongs to the page: page:ffffea0002b89000 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002b85788 ffffea0002b8a188 ffff88813bff0c40 raw: 0000000000000000 ffff8880ae2402c0 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880ae241280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880ae241300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880ae241380: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880ae241400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880ae241480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================