vcan0: j1939_xtp_rx_dat_one: 0xffff88806657b800: Data of RX-looped back packet (00 ff ff ff ff ff ff) doesn't match TX data (00 00 00 00 00 00 00)! ================================================================== BUG: KASAN: use-after-free in j1939_xtp_rx_dat_one+0xe12/0xee0 net/can/j1939/transport.c:1877 Read of size 1 at addr ffff888074f18cce by task ksoftirqd/3/31 CPU: 3 PID: 31 Comm: ksoftirqd/3 Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 j1939_xtp_rx_dat_one+0xe12/0xee0 net/can/j1939/transport.c:1877 j1939_xtp_rx_dat net/can/j1939/transport.c:1929 [inline] j1939_tp_recv+0x6de/0xcb0 net/can/j1939/transport.c:2123 j1939_can_recv+0x6ff/0x9a0 net/can/j1939/main.c:108 deliver net/can/af_can.c:574 [inline] can_rcv_filter+0x5d4/0x8d0 net/can/af_can.c:608 can_receive+0x31d/0x580 net/can/af_can.c:665 can_rcv+0x120/0x1c0 net/can/af_can.c:696 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xb3/0x6e0 net/core/dev.c:6365 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:6519 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 25931: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] kmem_cache_alloc_node+0x2c3/0x4f0 mm/slub.c:3266 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1158 [inline] alloc_skb_with_frags+0x93/0x620 net/core/skbuff.c:5956 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2586 j1939_sk_alloc_skb net/can/j1939/socket.c:861 [inline] j1939_sk_send_loop net/can/j1939/socket.c:1118 [inline] j1939_sk_sendmsg+0x6eb/0x13e0 net/can/j1939/socket.c:1253 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 sock_no_sendpage+0xf6/0x140 net/core/sock.c:3091 kernel_sendpage.part.0+0x1a0/0x340 net/socket.c:3492 kernel_sendpage net/socket.c:3489 [inline] sock_sendpage+0xe5/0x140 net/socket.c:1007 pipe_to_sendpage+0x2ad/0x380 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x43e/0x8a0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0xd4/0x140 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x110/0x180 fs/splice.c:936 splice_direct_to_actor+0x34b/0x8c0 fs/splice.c:891 do_splice_direct+0x1b3/0x280 fs/splice.c:979 do_sendfile+0xaf2/0x1250 fs/read_write.c:1245 __do_compat_sys_sendfile fs/read_write.c:1331 [inline] __se_compat_sys_sendfile fs/read_write.c:1314 [inline] __ia32_compat_sys_sendfile+0x1dd/0x220 fs/read_write.c:1314 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 15: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kmem_cache_free+0xd7/0x370 mm/slub.c:3526 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:700 kfree_skb_reason+0x85/0x110 include/linux/refcount.h:279 kfree_skb include/linux/skbuff.h:1114 [inline] j1939_session_skb_drop_old net/can/j1939/transport.c:340 [inline] j1939_xtp_rx_cts_one net/can/j1939/transport.c:1434 [inline] j1939_xtp_rx_cts+0xbd8/0x1170 net/can/j1939/transport.c:1473 j1939_tp_cmd_recv net/can/j1939/transport.c:2061 [inline] j1939_tp_recv+0x83c/0xcb0 net/can/j1939/transport.c:2133 j1939_can_recv+0x6ff/0x9a0 net/can/j1939/main.c:108 deliver net/can/af_can.c:574 [inline] can_rcv_filter+0x5d4/0x8d0 net/can/af_can.c:608 can_receive+0x31d/0x580 net/can/af_can.c:665 can_rcv+0x120/0x1c0 net/can/af_can.c:696 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xb3/0x6e0 net/core/dev.c:6365 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:6519 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 The buggy address belongs to the object at ffff888074f18c80 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 78 bytes inside of 232-byte region [ffff888074f18c80, ffff888074f18d68) The buggy address belongs to the page: page:ffffea0001d3c600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888074f197c0 pfn:0x74f18 head:ffffea0001d3c600 order:1 compound_mapcount:0 flags: 0x4fff00000010200(slab|head|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000010200 ffffea0001969908 ffffea00014a6208 ffff888011d98640 raw: ffff888074f197c0 0000000000190017 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 15, ts 1577300761499, free_ts 1577263467034 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x3cb/0x4b0 mm/slub.c:3243 skb_clone+0x170/0x3c0 net/core/skbuff.c:1519 j1939_can_recv+0x74/0x9a0 net/can/j1939/main.c:50 deliver net/can/af_can.c:574 [inline] can_rcv_filter+0x5d4/0x8d0 net/can/af_can.c:608 can_receive+0x31d/0x580 net/can/af_can.c:665 can_rcv+0x120/0x1c0 net/can/af_can.c:696 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797 __napi_poll+0xb3/0x6e0 net/core/dev.c:6365 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6d/0x160 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x256/0x450 mm/slub.c:4420 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] tomoyo_encode2.part.0+0xe9/0x3a0 security/tomoyo/realpath.c:45 tomoyo_encode2 security/tomoyo/realpath.c:31 [inline] tomoyo_encode+0x28/0x50 security/tomoyo/realpath.c:80 tomoyo_path_perm+0x368/0x400 security/tomoyo/file.c:831 tomoyo_path_symlink+0x94/0xe0 security/tomoyo/tomoyo.c:199 security_path_symlink+0xdf/0x150 security/security.c:1168 do_symlinkat+0x106/0x2e0 fs/namei.c:4323 __do_sys_symlink fs/namei.c:4350 [inline] __se_sys_symlink fs/namei.c:4348 [inline] __ia32_sys_symlink+0x74/0x90 fs/namei.c:4348 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Memory state around the buggy address: ffff888074f18b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888074f18c00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc >ffff888074f18c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888074f18d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888074f18d80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================