================================================================== BUG: KASAN: use-after-free in memcpy include/linux/string.h:377 [inline] BUG: KASAN: use-after-free in skb_put_data include/linux/skbuff.h:2130 [inline] BUG: KASAN: use-after-free in bcm_can_tx+0x3d4/0x800 net/can/bcm.c:295 Read of size 72 at addr ffff8880497e5498 by task kworker/0:0/9633 CPU: 0 PID: 9633 Comm: kworker/0:0 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Workqueue: events defense_work_handler 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+0x8f/0xa0 mm/kasan/report.c:412 memcpy+0x20/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:377 [inline] skb_put_data include/linux/skbuff.h:2130 [inline] bcm_can_tx+0x3d4/0x800 net/can/bcm.c:295 bcm_tx_timeout_tsklet+0x1f0/0x3a0 net/can/bcm.c:414 tasklet_action_common.constprop.0+0x265/0x360 kernel/softirq.c:522 __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:should_resched arch/x86/include/asm/preempt.h:99 [inline] RIP: 0010:__local_bh_enable_ip+0x18d/0x270 kernel/softirq.c:196 Code: 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 dd 00 00 00 48 83 3d c8 5f b8 08 00 0f 84 8d 00 00 00 fb 66 0f 1f 44 00 00 <65> 8b 05 6c bc c8 7e 85 c0 74 7d 5b 5d 41 5c c3 80 3d f3 87 d5 09 RSP: 0018:ffff888090c57bd8 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff13e3053 RBX: 0000000000000200 RCX: 1ffff110165b59ca RDX: dffffc0000000000 RSI: ffff8880b2dace30 RDI: ffff8880b2dace04 RBP: ffffffff86cc2127 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880b2dac580 R13: 0000000000000400 R14: 0000000000000000 R15: ffff88809becb620 local_bh_enable include/linux/bottom_half.h:32 [inline] update_defense_level+0xa6a/0x10f0 net/netfilter/ipvs/ip_vs_ctl.c:215 defense_work_handler+0x25/0xe0 net/netfilter/ipvs/ip_vs_ctl.c:229 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 13020: __do_kmalloc mm/slab.c:3727 [inline] __kmalloc+0x15a/0x3c0 mm/slab.c:3736 kmalloc_array include/linux/slab.h:637 [inline] bcm_tx_setup net/can/bcm.c:957 [inline] bcm_sendmsg+0x316c/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 13022: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 bcm_remove_op+0x213/0x2c0 net/can/bcm.c:770 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 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 get_signal+0x3f2/0x1f70 kernel/signal.c:2589 do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath+0x3f0/0x4a0 arch/x86/entry/common.c:271 ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:407 The buggy address belongs to the object at ffff8880497e4640 which belongs to the cache kmalloc-32768 of size 32768 The buggy address is located 3672 bytes inside of 32768-byte region [ffff8880497e4640, ffff8880497ec640) The buggy address belongs to the page: page:ffffea000125f800 count:1 mapcount:0 mapping:ffff88813bff2380 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0001424008 ffffea00013bc808 ffff88813bff2380 raw: 0000000000000000 ffff8880497e4640 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880497e5380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880497e5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880497e5480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880497e5500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880497e5580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 6 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 dd test %ebx,%ebp c: 00 00 add %al,(%rax) e: 00 48 83 add %cl,-0x7d(%rax) 11: 3d c8 5f b8 08 cmp $0x8b85fc8,%eax 16: 00 0f add %cl,(%rdi) 18: 84 8d 00 00 00 fb test %cl,-0x5000000(%rbp) 1e: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) * 24: 65 8b 05 6c bc c8 7e mov %gs:0x7ec8bc6c(%rip),%eax # 0x7ec8bc97 <-- trapping instruction 2b: 85 c0 test %eax,%eax 2d: 74 7d je 0xac 2f: 5b pop %rbx 30: 5d pop %rbp 31: 41 5c pop %r12 33: c3 retq 34: 80 .byte 0x80 35: 3d f3 87 d5 09 cmp $0x9d587f3,%eax