vcan0: j1939_tp_rxtimer: 0x00000000427ca589: rx timeout, send abort vcan0: j1939_xtp_rx_abort_one: 0x00000000427ca589: 0x00000: (3) A timeout occurred and this is the connection abort to close the session. ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 Read of size 8 at addr ffff8880a84a5080 by task syz-executor.0/12261 CPU: 0 PID: 12261 Comm: syz-executor.0 Not tainted 5.4.0-rc6+ #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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 lock_acquire+0x190/0x410 kernel/locking/lockdep.c:4487 __raw_spin_lock_bh include/linux/spinlock_api_smp.h:135 [inline] _raw_spin_lock_bh+0x33/0x50 kernel/locking/spinlock.c:175 spin_lock_bh include/linux/spinlock.h:343 [inline] j1939_session_list_lock net/can/j1939/transport.c:238 [inline] j1939_session_get_by_addr+0x2d/0x60 net/can/j1939/transport.c:530 j1939_xtp_rx_abort_one+0x8d/0x100 net/can/j1939/transport.c:1242 j1939_xtp_rx_abort net/can/j1939/transport.c:1270 [inline] j1939_tp_cmd_recv net/can/j1939/transport.c:1958 [inline] j1939_tp_recv+0x798/0x9b0 net/can/j1939/transport.c:1991 j1939_can_recv+0x4bb/0x620 net/can/j1939/main.c:100 deliver net/can/af_can.c:568 [inline] can_rcv_filter+0x292/0x8e0 net/can/af_can.c:602 can_receive+0x2e7/0x530 net/can/af_can.c:659 can_rcv+0x133/0x1b0 net/can/af_can.c:685 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:4929 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5043 process_backlog+0x206/0x750 net/core/dev.c:5874 napi_poll net/core/dev.c:6311 [inline] net_rx_action+0x508/0x1120 net/core/dev.c:6379 __do_softirq+0x262/0x98c kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x19b/0x1e0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 RIP: 0010:migrate_page_move_mapping+0x1e5f/0x30b0 mm/migrate.c:503 Code: ff df 48 c1 e8 03 80 3c 10 00 0f 85 de 0e 00 00 48 83 3d 13 1a 44 07 00 0f 84 8b 08 00 00 e8 a8 23 c4 ff fb 66 0f 1f 44 00 00 <45> 31 e4 e9 27 f4 ff ff e8 94 23 c4 ff 4c 89 f2 48 b8 00 00 00 00 RSP: 0018:ffff8880622879b0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000040000 RBX: ffff888062287ad0 RCX: ffffc90005f7f000 RDX: 0000000000040000 RSI: ffffffff81af03e8 RDI: ffff888069544b54 RBP: ffff888062287af8 R08: 1ffffffff14efd44 R09: fffffbfff14efd45 R10: fffffbfff14efd44 R11: ffffffff8a77ea27 R12: 0000000000000001 R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000 migrate_page+0x153/0x280 mm/migrate.c:684 move_to_new_page+0x3de/0x10c0 mm/migrate.c:950 __unmap_and_move mm/migrate.c:1116 [inline] unmap_and_move mm/migrate.c:1197 [inline] migrate_pages+0x21de/0x2e20 mm/migrate.c:1427 do_mbind mm/mempolicy.c:1300 [inline] kernel_mbind+0xb7c/0xe40 mm/mempolicy.c:1419 __do_sys_mbind mm/mempolicy.c:1426 [inline] __se_sys_mbind mm/mempolicy.c:1422 [inline] __x64_sys_mbind+0xe1/0x1a0 mm/mempolicy.c:1422 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4cdd0f9c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000ed RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 000000000045a219 RDX: 0000000000000000 RSI: 0000000000c0cc01 RDI: 0000000020012000 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0002000000000002 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4cdd0fa6d4 R13: 00000000004c6ba3 R14: 00000000004dc250 R15: 00000000ffffffff Allocated by task 12262: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3550 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] j1939_priv_create net/can/j1939/main.c:122 [inline] j1939_netdev_start+0xa4/0x550 net/can/j1939/main.c:251 j1939_sk_bind+0x65a/0x8e0 net/can/j1939/socket.c:438 __sys_bind+0x239/0x290 net/socket.c:1647 __do_sys_bind net/socket.c:1658 [inline] __se_sys_bind net/socket.c:1656 [inline] __x64_sys_bind+0x73/0xb0 net/socket.c:1656 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 12230: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 __j1939_priv_release net/can/j1939/main.c:154 [inline] kref_put include/linux/kref.h:65 [inline] j1939_priv_put+0x8b/0xb0 net/can/j1939/main.c:159 j1939_netdev_stop+0x45/0x190 net/can/j1939/main.c:291 j1939_sk_release+0x3bd/0x5c0 net/can/j1939/socket.c:580 __sock_release+0xce/0x280 net/socket.c:590 sock_close+0x1e/0x30 net/socket.c:1268 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a84a4000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4224 bytes inside of 8192-byte region [ffff8880a84a4000, ffff8880a84a6000) The buggy address belongs to the page: page:ffffea0002a12900 refcount:1 mapcount:0 mapping:ffff8880aa4021c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001bd9708 ffffea000238f208 ffff8880aa4021c0 raw: 0000000000000000 ffff8880a84a4000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a84a4f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a84a5000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a84a5080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a84a5100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a84a5180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================