netlink: 24 bytes leftover after parsing attributes in process `syz-executor.1'. ================================================================== BUG: KASAN: use-after-free in bcm_can_tx+0x726/0x800 net/can/bcm.c:295 Read of size 4 at addr ffff8880aa298604 by task syz-executor.4/30584 CPU: 1 PID: 30584 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 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_load4_noabort+0x88/0x90 mm/kasan/report.c:432 bcm_can_tx+0x726/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:arch_local_save_flags arch/x86/include/asm/paravirt.h:784 [inline] RIP: 0010:arch_local_irq_save arch/x86/include/asm/paravirt.h:806 [inline] RIP: 0010:lock_is_held_type+0x82/0x210 kernel/locking/lockdep.c:3942 Code: f1 89 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 6a 01 00 00 48 83 3d 36 cd a6 08 00 0f 84 1d 01 00 00 9c 58 <0f> 1f 44 00 00 48 ba 00 00 00 00 00 fc ff df 48 89 c3 48 c7 c0 90 RSP: 0018:ffff888040897730 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000286 RBX: ffff8880a8640480 RCX: 0000000000000001 RDX: dffffc0000000000 RSI: 00000000ffffffff RDI: ffff8880a8640d04 RBP: ffffffff89f85f20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000005 R11: 0000000000000000 R12: ffff8880a8640480 R13: 000000000002b0c0 R14: ffff888040890000 R15: ffff8880ba12b0c0 lock_is_held include/linux/lockdep.h:344 [inline] schedule_debug kernel/sched/core.c:3337 [inline] __schedule+0xf7f/0x2040 kernel/sched/core.c:3439 overlayfs: unrecognized mount option "loRz10>*)xdirprBK$C" or missing value preempt_schedule_irq+0xb0/0x140 kernel/sched/core.c:3744 retint_kernel+0x1b/0x2d RIP: 0010:unlink_file_vma+0x2b/0xb0 mm/mmap.c:157 Code: 56 41 55 41 54 55 48 89 fd e8 d1 b0 d4 ff 48 8d bd a0 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 <75> 66 4c 8b a5 a0 00 00 00 4d 85 e4 74 4e e8 a2 b0 d4 ff 49 8d bc RSP: 0018:ffff888040897900 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: dffffc0000000000 RBX: ffff8880b3a63318 RCX: ffffffff818b5f7c RDX: 1ffff1101674c677 RSI: ffffffff818dd49f RDI: ffff8880b3a633b8 RBP: ffff8880b3a63318 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000007 R11: 0000000000000000 R12: ffff8880b3a63420 R13: 00007f3f0b5eb000 R14: 00007f3f0a1fb000 R15: 0000000000000000 free_pgtables+0x1b3/0x2f0 mm/memory.c:653 exit_mmap+0x2c8/0x530 mm/mmap.c:3094 __mmput kernel/fork.c:1016 [inline] mmput+0x14e/0x4a0 kernel/fork.c:1037 exit_mm kernel/exit.c:549 [inline] do_exit+0xaec/0x2be0 kernel/exit.c:857 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 overlayfs: fs on './file0' does not support file handles, falling back to index=off,nfs_export=off. 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 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:0x7f3f0be770c9 Code: Bad RIP value. RSP: 002b:00007f3f0a3e9168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: 0000000000000044 RBX: 00007f3f0bf96f80 RCX: 00007f3f0be770c9 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f3f0bed2ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc90ab56ff R14: 00007f3f0a3e9300 R15: 0000000000022000 Allocated by task 30648: 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 30648: __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 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 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 ffff8880aa2984c0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 324 bytes inside of 1024-byte region [ffff8880aa2984c0, ffff8880aa2988c0) The buggy address belongs to the page: page:ffffea0002a8a600 count:1 mapcount:0 mapping:ffff88813bff0ac0 index:0xffff8880aa2996c0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002a93e08 ffffea00023d8f08 ffff88813bff0ac0 raw: ffff8880aa2996c0 ffff8880aa298040 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880aa298500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aa298580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880aa298600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880aa298680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aa298700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 7: fc ff df a: 48 c1 e8 03 shr $0x3,%rax e: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1) 12: 0f 85 6a 01 00 00 jne 0x182 18: 48 83 3d 36 cd a6 08 cmpq $0x0,0x8a6cd36(%rip) # 0x8a6cd56 1f: 00 20: 0f 84 1d 01 00 00 je 0x143 26: 9c pushfq 27: 58 pop %rax * 28: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) <-- trapping instruction 2d: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 34: fc ff df 37: 48 89 c3 mov %rax,%rbx 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: c0 .byte 0xc0 3d: 90 nop