================================================================== BUG: KASAN: use-after-free in tasklet_action_common.constprop.0+0x29e/0x360 kernel/softirq.c:515 Read of size 8 at addr ffff8880a257ae90 by task syz-executor.0/8320 CPU: 1 PID: 8320 Comm: syz-executor.0 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023 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_load8_noabort+0x88/0x90 mm/kasan/report.c:433 tasklet_action_common.constprop.0+0x29e/0x360 kernel/softirq.c:515 __do_softirq+0x265/0x980 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:372 [inline] irq_exit+0x215/0x260 kernel/softirq.c:412 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:789 [inline] RIP: 0010:queue_work_on+0x165/0x1f0 kernel/workqueue.c:1493 Code: 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 87 00 00 00 48 83 3d df 54 b3 08 00 74 43 e8 c0 57 24 00 48 89 df 57 9d <0f> 1f 44 00 00 eb a9 e8 af 57 24 00 4c 89 e2 4c 89 ee 89 ef e8 82 RSP: 0018:ffff88806282fa40 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: ffff88809e996040 RBX: 0000000000000293 RCX: 1ffff11013d32d27 RDX: 0000000000000000 RSI: ffffffff813e2db0 RDI: 0000000000000293 RBP: 0000000000000200 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88806282fb50 R13: ffff88813bfcda80 R14: 0000000000000001 R15: 0000000000000000 queue_work include/linux/workqueue.h:512 [inline] _synchronize_rcu_expedited+0x352/0x6f0 kernel/rcu/tree_exp.h:680 synchronize_rcu+0xc6/0x160 kernel/rcu/tree_plugin.h:818 bcm_release+0x527/0x950 net/can/bcm.c:1590 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f145fb4efab Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffe62bec9a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 00007f145fb4efab RDX: 0000001b2d520000 RSI: 00007f145f111640 RDI: 0000000000000004 RBP: 00007f145fcbe980 R08: 0000000000000000 R09: 000000003253460c R10: 000fa8212d8d63ed R11: 0000000000000293 R12: 000000000013052c R13: 00007ffe62becaa0 R14: 00007f145fcbd1f0 R15: 0000000000000032 Allocated by task 8325: kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] bcm_tx_setup net/can/bcm.c:947 [inline] bcm_sendmsg+0x25d7/0x4150 net/can/bcm.c:1386 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227 __sys_sendmsg net/socket.c:2265 [inline] __do_sys_sendmsg net/socket.c:2274 [inline] __se_sys_sendmsg net/socket.c:2272 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8320: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 bcm_release+0x260/0x950 net/can/bcm.c:1561 __sock_release+0xcd/0x2a0 net/socket.c:599 sock_close+0x15/0x20 net/socket.c:1214 __fput+0x2ce/0x890 fs/file_table.c:278 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a257adc0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 208 bytes inside of 1024-byte region [ffff8880a257adc0, ffff8880a257b1c0) The buggy address belongs to the page: page:ffffea0002895e80 count:1 mapcount:0 mapping:ffff88813bff0ac0 index:0xffff8880a257bb40 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002779288 ffffea00018b0308 ffff88813bff0ac0 raw: ffff8880a257bb40 ffff8880a257a040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a257ad80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff8880a257ae00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a257ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a257af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a257af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 7 bytes skipped: 0: df 48 c1 fisttps -0x3f(%rax) 3: e8 03 80 3c 10 callq 0x103c800b 8: 00 0f add %cl,(%rdi) a: 85 87 00 00 00 48 test %eax,0x48000000(%rdi) 10: 83 3d df 54 b3 08 00 cmpl $0x0,0x8b354df(%rip) # 0x8b354f6 17: 74 43 je 0x5c 19: e8 c0 57 24 00 callq 0x2457de 1e: 48 89 df mov %rbx,%rdi 21: 57 push %rdi 22: 9d popfq * 23: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) <-- trapping instruction 28: eb a9 jmp 0xffffffd3 2a: e8 af 57 24 00 callq 0x2457de 2f: 4c 89 e2 mov %r12,%rdx 32: 4c 89 ee mov %r13,%rsi 35: 89 ef mov %ebp,%edi 37: e8 .byte 0xe8 38: 82 .byte 0x82