================================================================== BUG: KASAN: use-after-free in j1939_session_deactivate+0x78/0x80 net/can/j1939/transport.c:1033 Read of size 8 at addr ffff8880a5d36000 by task ksoftirqd/0/9 CPU: 0 PID: 9 Comm: ksoftirqd/0 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+0x113/0x167 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x318 mm/kasan/report.c:351 __kasan_report.cold.9+0x1b/0x3f 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+0xc1/0x241 net/can/j1939/transport.c:1150 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x32f/0xb50 kernel/time/hrtimer.c:1451 hrtimer_run_softirq+0x16c/0x250 kernel/time/hrtimer.c:1465 __do_softirq+0x262/0x9a8 kernel/softirq.c:292 run_ksoftirqd+0x94/0x100 kernel/softirq.c:603 smpboot_thread_fn+0x55f/0x8b0 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 7954: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc.constprop.13+0xc7/0xd0 mm/kasan/common.c:493 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 kmem_cache_alloc_trace+0x15b/0x780 mm/slab.c:3550 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:748 [inline] j1939_session_new+0x6a/0x3b0 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+0x9f0/0x1260 net/can/j1939/socket.c:1100 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xb5/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+0x2d2/0x720 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+0x481/0xd10 fs/read_write.c:1464 __do_sys_sendfile64 fs/read_write.c:1525 [inline] __se_sys_sendfile64 fs/read_write.c:1511 [inline] __x64_sys_sendfile64+0x198/0x1e0 fs/read_write.c:1511 do_syscall_64+0xd0/0x540 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9: save_stack+0x21/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kfree+0x108/0x2c0 mm/slab.c:3756 j1939_session_destroy net/can/j1939/transport.c:272 [inline] __j1939_session_release+0xb1/0x110 net/can/j1939/transport.c:280 kref_put include/linux/kref.h:65 [inline] j1939_session_put net/can/j1939/transport.c:285 [inline] j1939_session_deactivate_locked+0x20b/0x2b0 net/can/j1939/transport.c:1021 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+0xc1/0x241 net/can/j1939/transport.c:1150 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x32f/0xb50 kernel/time/hrtimer.c:1451 hrtimer_run_softirq+0x16c/0x250 kernel/time/hrtimer.c:1465 __do_softirq+0x262/0x9a8 kernel/softirq.c:292 The buggy address belongs to the object at ffff8880a5d36000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff8880a5d36000, ffff8880a5d36200) The buggy address belongs to the page: page:ffffea0002974d80 refcount:1 mapcount:0 mapping:ffff8880aa400a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002627948 ffffea0002a39ec8 ffff8880aa400a80 raw: 0000000000000000 ffff8880a5d36000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a5d35f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880a5d35f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a5d36000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a5d36080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a5d36100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================