vcan0: j1939_xtp_rx_dat: no tx connection found ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x3a8b/0x4a00 kernel/locking/lockdep.c:3828 Read of size 8 at addr ffff88808f3d1080 by task ksoftirqd/1/16 CPU: 1 PID: 16 Comm: ksoftirqd/1 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_dat net/can/j1939/transport.c:1793 [inline] j1939_tp_recv+0x413/0x9b0 net/can/j1939/transport.c:1963 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 run_ksoftirqd kernel/softirq.c:603 [inline] run_ksoftirqd+0x8e/0x110 kernel/softirq.c:595 smpboot_thread_fn+0x6a3/0xa40 kernel/smpboot.c:165 kthread+0x361/0x430 kernel/kthread.c:255 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352 Allocated by task 9: 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 __do_kmalloc_node mm/slab.c:3615 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3629 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:141 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:209 alloc_skb include/linux/skbuff.h:1049 [inline] _sctp_make_chunk+0x5e/0x280 net/sctp/sm_make_chunk.c:1394 sctp_make_control net/sctp/sm_make_chunk.c:1441 [inline] sctp_make_init_ack+0x4c8/0xdc0 net/sctp/sm_make_chunk.c:472 sctp_sf_do_5_1B_init+0x95b/0xe50 net/sctp/sm_statefuns.c:416 sctp_do_sm+0x121/0x5170 net/sctp/sm_sideeffect.c:1152 sctp_endpoint_bh_rcv+0x409/0x8d0 net/sctp/endpointola.c:394 sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:80 sctp_rcv+0xfde/0x35f0 net/sctp/input.c:256 sctp6_rcv+0x17/0x30 net/sctp/ipv6.c:1049 ip6_protocol_deliver_rcu+0x2fe/0x1670 net/ipv6/ip6_input.c:409 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:450 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ip6_input+0xe4/0x3f0 net/ipv6/ip6_input.c:459 dst_input include/net/dst.h:442 [inline] ip6_rcv_finish+0x1de/0x310 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:284 __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 Freed by task 9: 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 skb_free_head+0x93/0xb0 net/core/skbuff.c:591 skb_release_data+0x42d/0x7c0 net/core/skbuff.c:611 skb_release_all+0x4d/0x60 net/core/skbuff.c:665 __kfree_skb net/core/skbuff.c:679 [inline] consume_skb net/core/skbuff.c:838 [inline] consume_skb+0xfb/0x3b0 net/core/skbuff.c:832 sctp_chunk_destroy net/sctp/sm_make_chunk.c:1454 [inline] sctp_chunk_put+0x192/0x280 net/sctp/sm_make_chunk.c:1481 sctp_chunk_free+0x56/0x70 net/sctp/sm_make_chunk.c:1468 sctp_packet_pack net/sctp/output.c:483 [inline] sctp_packet_transmit+0x1219/0x36c0 net/sctp/output.c:597 sctp_packet_singleton net/sctp/outqueue.c:772 [inline] sctp_outq_flush_ctrl.constprop.0+0x73c/0xd30 net/sctp/outqueue.c:903 sctp_outq_flush+0xe8/0x2780 net/sctp/outqueue.c:1185 sctp_outq_uncork+0x6c/0x80 net/sctp/outqueue.c:757 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1313 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1184 [inline] sctp_do_sm+0x3c3a/0x5170 net/sctp/sm_sideeffect.c:1155 sctp_endpoint_bh_rcv+0x409/0x8d0 net/sctp/endpointola.c:394 sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:80 sctp_rcv+0xfde/0x35f0 net/sctp/input.c:256 sctp6_rcv+0x17/0x30 net/sctp/ipv6.c:1049 ip6_protocol_deliver_rcu+0x2fe/0x1670 net/ipv6/ip6_input.c:409 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:450 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ip6_input+0xe4/0x3f0 net/ipv6/ip6_input.c:459 dst_input include/net/dst.h:442 [inline] ip6_rcv_finish+0x1de/0x310 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:305 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:284 __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 The buggy address belongs to the object at ffff88808f3d0000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4224 bytes inside of 8192-byte region [ffff88808f3d0000, ffff88808f3d2000) The buggy address belongs to the page: page:ffffea00023cf400 refcount:1 mapcount:0 mapping:ffff8880aa4021c0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000292c108 ffffea00018ab208 ffff8880aa4021c0 raw: 0000000000000000 ffff88808f3d0000 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808f3d0f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f3d1000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808f3d1080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808f3d1100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808f3d1180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================