================================================================== BUG: KASAN: use-after-free in bcm_can_tx+0x726/0x800 net/can/bcm.c:295 Read of size 4 at addr ffff888094a0ea84 by task sshd/8117 CPU: 1 PID: 8117 Comm: sshd 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 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1092 do_softirq.part.0+0x160/0x1c0 kernel/softirq.c:336 do_softirq kernel/softirq.c:328 [inline] __local_bh_enable_ip+0x20e/0x270 kernel/softirq.c:189 lock_sock include/net/sock.h:1512 [inline] tcp_sendmsg+0x1d/0x40 net/ipv4/tcp.c:1461 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798 netlink: 12 bytes leftover after parsing attributes in process `syz-executor.4'. sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 sock_write_iter+0x287/0x3c0 net/socket.c:966 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f4dc7573970 Code: 73 01 c3 48 8b 0d 28 d5 2b 00 f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 83 3d 99 2d 2c 00 00 75 10 b8 01 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 7e 9b 01 00 48 89 04 24 RSP: 002b:00007ffea4bd0cb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 0000000000000b7c RCX: 00007f4dc7573970 RDX: 0000000000000b7c RSI: 00005614465a08a0 RDI: 0000000000000003 RBP: 000056144658be30 R08: 00007ffea4bd0d70 R09: 0000000000006000 R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffea4bd0d4f R14: 00005614449a9be7 R15: 0000000000000003 Allocated by task 11959: 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 11946: __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 ffff888094a0e940 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 324 bytes inside of 1024-byte region [ffff888094a0e940, ffff888094a0ed40) The buggy address belongs to the page: page:ffffea0002528380 count:1 mapcount:0 mapping:ffff88813bff0ac0 index:0xffff888094a0edc0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00026b4208 ffffea0002a75508 ffff88813bff0ac0 raw: ffff888094a0edc0 ffff888094a0e040 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094a0e980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094a0ea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888094a0ea80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888094a0eb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094a0eb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================