================================================================== BUG: KASAN: slab-use-after-free in skb_zcopy include/linux/skbuff.h:1662 [inline] BUG: KASAN: slab-use-after-free in skb_release_data+0x734/0x820 net/core/skbuff.c:933 Read of size 1 at addr ffff888078b6eec0 by task ksoftirqd/1/21 CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 6.3.0-next-20230505-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:351 print_report mm/kasan/report.c:462 [inline] kasan_report+0x11c/0x130 mm/kasan/report.c:572 skb_zcopy include/linux/skbuff.h:1662 [inline] skb_release_data+0x734/0x820 net/core/skbuff.c:933 skb_release_all net/core/skbuff.c:1014 [inline] __kfree_skb net/core/skbuff.c:1028 [inline] consume_skb net/core/skbuff.c:1244 [inline] consume_skb+0xd2/0x170 net/core/skbuff.c:1238 j1939_xtp_rx_dat_one+0x8b9/0xea0 net/can/j1939/transport.c:1914 j1939_xtp_rx_dat net/can/j1939/transport.c:1940 [inline] j1939_tp_recv+0x7d5/0xf50 net/can/j1939/transport.c:2134 j1939_can_recv net/can/j1939/main.c:112 [inline] j1939_can_recv+0x78e/0xa80 net/can/j1939/main.c:38 deliver net/can/af_can.c:572 [inline] can_rcv_filter+0x5d4/0x8d0 net/can/af_can.c:606 can_receive+0x31d/0x5c0 net/can/af_can.c:663 can_rcv+0x1e1/0x280 net/can/af_can.c:687 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5491 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5605 process_backlog+0x13e/0x6d0 net/core/dev.c:5933 __napi_poll+0xb3/0x520 net/core/dev.c:6496 napi_poll net/core/dev.c:6563 [inline] net_rx_action+0x8e4/0xd00 net/core/dev.c:6696 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 run_ksoftirqd kernel/softirq.c:939 [inline] run_ksoftirqd+0x31/0x60 kernel/softirq.c:931 smpboot_thread_fn+0x659/0x9f0 kernel/smpboot.c:164 kthread+0x344/0x440 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 5513: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] ____kasan_kmalloc mm/kasan/common.c:333 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:966 [inline] __kmalloc_node_track_caller+0x5f/0x1a0 mm/slab_common.c:986 kmalloc_reserve+0xf0/0x270 net/core/skbuff.c:585 __alloc_skb+0x129/0x330 net/core/skbuff.c:654 alloc_skb include/linux/skbuff.h:1288 [inline] alloc_skb_with_frags+0x9a/0x6c0 net/core/skbuff.c:6378 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2729 sock_alloc_send_skb include/net/sock.h:1860 [inline] j1939_sk_alloc_skb net/can/j1939/socket.c:864 [inline] j1939_sk_send_loop net/can/j1939/socket.c:1121 [inline] j1939_sk_sendmsg+0x6ba/0x13a0 net/can/j1939/socket.c:1256 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 sock_no_sendpage+0x10c/0x160 net/core/sock.c:3230 kernel_sendpage.part.0+0x1d5/0x700 net/socket.c:3582 kernel_sendpage net/socket.c:3579 [inline] sock_sendpage+0xe7/0x180 net/socket.c:1082 pipe_to_sendpage+0x2b1/0x380 fs/splice.c:474 splice_from_pipe_feed fs/splice.c:528 [inline] __splice_from_pipe+0x44b/0x8a0 fs/splice.c:672 splice_from_pipe fs/splice.c:707 [inline] generic_splice_sendpage+0xd8/0x140 fs/splice.c:855 do_splice_from fs/splice.c:876 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1042 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:997 do_splice_direct+0x1ab/0x280 fs/splice.c:1085 do_sendfile+0xb19/0x12c0 fs/read_write.c:1254 __do_sys_sendfile64 fs/read_write.c:1322 [inline] __se_sys_sendfile64 fs/read_write.c:1308 [inline] __x64_sys_sendfile64+0x1d0/0x210 fs/read_write.c:1308 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4997: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1807 slab_free mm/slub.c:3786 [inline] __kmem_cache_free+0xaf/0x2d0 mm/slub.c:3799 skb_kfree_head net/core/skbuff.c:906 [inline] skb_free_head+0x110/0x1b0 net/core/skbuff.c:918 skb_release_data+0x598/0x820 net/core/skbuff.c:948 skb_release_all net/core/skbuff.c:1014 [inline] __kfree_skb net/core/skbuff.c:1028 [inline] kfree_skb_reason+0x11e/0x210 net/core/skbuff.c:1064 kfree_skb include/linux/skbuff.h:1236 [inline] j1939_session_skb_drop_old net/can/j1939/transport.c:347 [inline] j1939_xtp_rx_cts_one net/can/j1939/transport.c:1445 [inline] j1939_xtp_rx_cts+0x614/0xfa0 net/can/j1939/transport.c:1484 j1939_tp_cmd_recv net/can/j1939/transport.c:2072 [inline] j1939_tp_recv+0x565/0xf50 net/can/j1939/transport.c:2144 j1939_can_recv net/can/j1939/main.c:112 [inline] j1939_can_recv+0x78e/0xa80 net/can/j1939/main.c:38 deliver net/can/af_can.c:572 [inline] can_rcv_filter+0x5d4/0x8d0 net/can/af_can.c:606 can_receive+0x31d/0x5c0 net/can/af_can.c:663 can_rcv+0x1e1/0x280 net/can/af_can.c:687 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5491 __netif_receive_skb+0x1f/0x1c0 net/core/dev.c:5605 process_backlog+0x13e/0x6d0 net/core/dev.c:5933 __napi_poll+0xb3/0x520 net/core/dev.c:6496 napi_poll net/core/dev.c:6563 [inline] net_rx_action+0x8e4/0xd00 net/core/dev.c:6696 __do_softirq+0x1d4/0x905 kernel/softirq.c:571 The buggy address belongs to the object at ffff888078b6e000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 3776 bytes inside of freed 4096-byte region [ffff888078b6e000, ffff888078b6f000) The buggy address belongs to the physical page: page:ffffea0001e2da00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78b68 head:ffffea0001e2da00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012442140 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4457, tgid 4457 (udevd), ts 77367114185, free_ts 77312391072 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2db/0x350 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0xf7c/0x2aa0 mm/page_alloc.c:3502 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:4768 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2279 alloc_slab_page mm/slub.c:1851 [inline] allocate_slab+0x28e/0x380 mm/slub.c:1998 new_slab mm/slub.c:2051 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3192 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3291 __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] __kmem_cache_alloc_node+0x136/0x320 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0x4e/0x190 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] tomoyo_realpath_from_path+0xc3/0x600 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822 security_inode_getattr+0xd3/0x140 security/security.c:2114 vfs_getattr fs/stat.c:167 [inline] vfs_statx+0x16e/0x430 fs/stat.c:242 vfs_fstatat+0x90/0xb0 fs/stat.c:276 __do_sys_newfstatat+0x8a/0x110 fs/stat.c:446 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x4dd/0xb90 mm/page_alloc.c:2564 free_unref_page+0x33/0x370 mm/page_alloc.c:2659 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x195/0x220 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] kmem_cache_alloc_node+0x185/0x3e0 mm/slub.c:3496 __alloc_skb+0x288/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1288 [inline] alloc_skb_with_frags+0x9a/0x6c0 net/core/skbuff.c:6378 sock_alloc_send_pskb+0x7a7/0x930 net/core/sock.c:2729 sock_alloc_send_skb include/net/sock.h:1860 [inline] mld_newpack.isra.0+0x1b9/0x760 net/ipv6/mcast.c:1748 add_grhead+0x295/0x340 net/ipv6/mcast.c:1851 add_grec+0x1053/0x1610 net/ipv6/mcast.c:1989 mld_send_initial_cr.part.0+0xe7/0x260 net/ipv6/mcast.c:2236 mld_send_initial_cr net/ipv6/mcast.c:1232 [inline] ipv6_mc_dad_complete+0x1d4/0x680 net/ipv6/mcast.c:2247 addrconf_dad_completed+0xa01/0xe00 net/ipv6/addrconf.c:4234 addrconf_dad_work+0x75d/0x1390 net/ipv6/addrconf.c:4162 Memory state around the buggy address: ffff888078b6ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078b6ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078b6ee80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078b6ef00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078b6ef80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================