vcan0: j1939_tp_rxtimer: 0x00000000e0fd8baa: abort rx timeout. Force session deactivation vcan0: j1939_tp_rxtimer: 0x0000000030164fd7: abort rx timeout. Force session deactivation ================================================================== BUG: KASAN: use-after-free in j1939_session_deactivate+0x78/0x80 net/can/j1939/transport.c:1033 Read of size 8 at addr ffff88809d102500 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 Not tainted 5.3.0-rc7-syzkaller #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+0x86/0xca lib/dump_stack.c:113 print_address_description.cold.4+0x9/0x35a mm/kasan/report.c:351 __kasan_report.cold.5+0x1b/0x3e mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 j1939_session_deactivate+0x78/0x80 net/can/j1939/transport.c:1033 j1939_session_deactivate_activate_next+0xd/0x20 net/can/j1939/transport.c:1041 j1939_tp_rxtimer+0xb6/0x226 net/can/j1939/transport.c:1150 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x332/0xb50 kernel/time/hrtimer.c:1451 hrtimer_run_softirq+0x16c/0x250 kernel/time/hrtimer.c:1465 __do_softirq+0x222/0x90d kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x30/0x50 kernel/softirq.c:595 smpboot_thread_fn+0x55f/0x8c0 kernel/smpboot.c:165 kthread+0x331/0x3f0 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 10861: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.part.0+0x44/0xc0 mm/kasan/common.c:493 __kasan_kmalloc.constprop.1+0xb1/0xc0 mm/kasan/common.c:474 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 kmem_cache_alloc_trace+0x135/0x340 mm/slub.c:2797 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] j1939_session_new+0x6a/0x490 net/can/j1939/transport.c:1384 j1939_tp_send+0x1a8/0x5d0 net/can/j1939/transport.c:1846 j1939_sk_send_loop net/can/j1939/socket.c:995 [inline] j1939_sk_sendmsg+0x9e7/0x1260 net/can/j1939/socket.c:1100 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:657 kernel_sendmsg+0x26/0x30 net/socket.c:677 sock_no_sendpage+0xfd/0x140 net/core/sock.c:2730 kernel_sendpage+0x60/0xd0 net/socket.c:3682 sock_sendpage+0x6d/0xd0 net/socket.c:935 pipe_to_sendpage+0x212/0x430 fs/splice.c:449 splice_from_pipe_feed fs/splice.c:500 [inline] __splice_from_pipe+0x297/0x6c0 fs/splice.c:624 splice_from_pipe+0xbb/0x120 fs/splice.c:659 generic_splice_sendpage+0x10/0x20 fs/splice.c:829 do_splice_from fs/splice.c:848 [inline] direct_splice_actor+0x104/0x1c0 fs/splice.c:1020 splice_direct_to_actor+0x303/0x870 fs/splice.c:975 do_splice_direct+0x14c/0x270 fs/splice.c:1063 do_sendfile+0x4b1/0xed0 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64+0x100/0x120 fs/read_write.c:1511 __x64_sys_sendfile64+0x92/0xf0 fs/read_write.c:1511 do_syscall_64+0xa3/0x4a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x145/0x210 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 slab_free_hook mm/slub.c:1423 [inline] slab_free_freelist_hook mm/slub.c:1474 [inline] slab_free mm/slub.c:3016 [inline] kfree+0xf7/0x380 mm/slub.c:3957 j1939_session_destroy net/can/j1939/transport.c:272 [inline] __j1939_session_release net/can/j1939/transport.c:280 [inline] kref_put include/linux/kref.h:65 [inline] j1939_session_put+0xf3/0x1b0 net/can/j1939/transport.c:285 j1939_session_deactivate_locked net/can/j1939/transport.c:1021 [inline] j1939_session_deactivate_locked+0x1e4/0x290 net/can/j1939/transport.c:1009 j1939_session_deactivate+0x38/0x80 net/can/j1939/transport.c:1032 j1939_session_deactivate_activate_next+0xd/0x20 net/can/j1939/transport.c:1041 j1939_tp_rxtimer+0xb6/0x226 net/can/j1939/transport.c:1150 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x332/0xb50 kernel/time/hrtimer.c:1451 hrtimer_run_softirq+0x16c/0x250 kernel/time/hrtimer.c:1465 __do_softirq+0x222/0x90d kernel/softirq.c:292 The buggy address belongs to the object at ffff88809d102500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff88809d102500, ffff88809d102700) The buggy address belongs to the page: page:ffffea0002744080 refcount:1 mapcount:0 mapping:ffff8880b5c02500 index:0x0 compound_mapcount: 0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 0000000000000000 0000000900000001 ffff8880b5c02500 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page allocated via order 1, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2147 [inline] prep_new_page+0x183/0x220 mm/page_alloc.c:2153 get_page_from_freelist.part.23+0x1378/0x43d0 mm/page_alloc.c:3680 get_page_from_freelist mm/page_alloc.c:4711 [inline] __alloc_pages_nodemask+0x324/0x26a0 mm/page_alloc.c:4714 alloc_pages_current+0xd6/0x1b0 mm/mempolicy.c:2153 alloc_pages include/linux/gfp.h:509 [inline] alloc_slab_page mm/slub.c:1515 [inline] allocate_slab mm/slub.c:1660 [inline] new_slab+0x7da/0x16a0 mm/slub.c:1727 new_slab_objects mm/slub.c:2476 [inline] ___slab_alloc+0x57b/0x8d0 mm/slub.c:2627 __slab_alloc.isra.23+0x4f/0x80 mm/slub.c:2667 slab_alloc_node mm/slub.c:2730 [inline] __kmalloc_node_track_caller+0x22c/0x450 mm/slub.c:4365 __kmalloc_reserve.isra.10+0x2c/0xc0 net/core/skbuff.c:141 __alloc_skb+0xd7/0x570 net/core/skbuff.c:209 alloc_skb include/linux/skbuff.h:1043 [inline] j1939_tp_tx_dat_new+0x3a/0x420 net/can/j1939/transport.c:564 j1939_tp_tx_dat net/can/j1939/transport.c:602 [inline] j1939_session_tx_dat net/can/j1939/transport.c:787 [inline] j1939_xtp_txnext_transmiter net/can/j1939/transport.c:843 [inline] j1939_tp_txtimer+0x757/0x1660 net/can/j1939/transport.c:1076 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x332/0xb50 kernel/time/hrtimer.c:1451 hrtimer_run_softirq+0x16c/0x250 kernel/time/hrtimer.c:1465 __do_softirq+0x222/0x90d kernel/softirq.c:292 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x30/0x50 kernel/softirq.c:595 Memory state around the buggy address: ffff88809d102400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809d102480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809d102500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809d102580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809d102600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================