syzbot


KASAN: slab-out-of-bounds Read in udp6_set_csum

Status: auto-closed as invalid on 2022/03/02 04:36
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 379d, last: 366d

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in lco_csum include/linux/skbuff.h:4703 [inline]
BUG: KASAN: slab-out-of-bounds in udp6_set_csum+0x4b8/0x530 net/ipv6/ip6_checksum.c:127
Read of size 2 at addr ffff88807bf30c02 by task syz-executor.2/9573

CPU: 1 PID: 9573 Comm: syz-executor.2 Not tainted 5.16.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106
 print_address_description+0x65/0x380 mm/kasan/report.c:247
 __kasan_report mm/kasan/report.c:433 [inline]
 kasan_report+0x19a/0x1f0 mm/kasan/report.c:450
 lco_csum include/linux/skbuff.h:4703 [inline]
 udp6_set_csum+0x4b8/0x530 net/ipv6/ip6_checksum.c:127
 udp_tunnel6_xmit_skb+0x21e/0x8f0 net/ipv6/ip6_udp_tunnel.c:97
 geneve6_xmit_skb drivers/net/geneve.c:1050 [inline]
 geneve_xmit+0x1913/0x2690 drivers/net/geneve.c:1079
 __netdev_start_xmit include/linux/netdevice.h:4987 [inline]
 netdev_start_xmit include/linux/netdevice.h:5001 [inline]
 xmit_one net/core/dev.c:3590 [inline]
 dev_hard_start_xmit+0x20b/0x450 net/core/dev.c:3606
 sch_direct_xmit+0x292/0x5b0 net/sched/sch_generic.c:342
 qdisc_restart net/sched/sch_generic.c:407 [inline]
 __qdisc_run+0x9dc/0x1cd0 net/sched/sch_generic.c:415
 __dev_xmit_skb net/core/dev.c:3875 [inline]
 __dev_queue_xmit+0xedd/0x35c0 net/core/dev.c:4194
 packet_snd net/packet/af_packet.c:3052 [inline]
 packet_sendmsg+0x4ca1/0x6750 net/packet/af_packet.c:3079
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg net/socket.c:724 [inline]
 __sys_sendto+0x42e/0x5b0 net/socket.c:2036
 __do_sys_sendto net/socket.c:2048 [inline]
 __se_sys_sendto net/socket.c:2044 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2044
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f68b72f1ae9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f68b4867188 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007f68b7404f60 RCX: 00007f68b72f1ae9
RDX: 0000000000003287 RSI: 0000000020000080 RDI: 0000000000000004
RBP: 00007f68b734bf6d R08: 0000000000000000 R09: 00000000000002ff
R10: 0000000004000002 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd018f0f9f R14: 00007f68b4867300 R15: 0000000000022000
 </TASK>

Allocated by task 135:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:269 [inline]
 __kmalloc+0x253/0x380 mm/slub.c:4423
 kmalloc include/linux/slab.h:595 [inline]
 kzalloc include/linux/slab.h:724 [inline]
 neigh_alloc net/core/neighbour.c:433 [inline]
 ___neigh_create+0x5f4/0x21c0 net/core/neighbour.c:618
 ip6_finish_output2+0x119c/0x14c0 net/ipv6/ip6_output.c:123
 dst_output include/net/dst.h:450 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ndisc_send_skb+0xa2f/0xf00 net/ipv6/ndisc.c:508
 addrconf_dad_completed+0x6a4/0xb90 net/ipv6/addrconf.c:4216
 addrconf_dad_work+0xfd6/0x1d10 net/ipv6/addrconf.c:4126
 process_one_work+0x853/0x1140 kernel/workqueue.c:2298
 worker_thread+0xac1/0x1320 kernel/workqueue.c:2445
 kthread+0x468/0x490 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30

Last potentially related work creation:
 kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38
 __kasan_record_aux_stack+0xfa/0x130 mm/kasan/generic.c:348
 kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3550
 neigh_del net/core/neighbour.c:225 [inline]
 neigh_remove_one+0x5ce/0x680 net/core/neighbour.c:246
 neigh_forced_gc net/core/neighbour.c:276 [inline]
 neigh_alloc net/core/neighbour.c:423 [inline]
 ___neigh_create+0x3aa/0x21c0 net/core/neighbour.c:618
 ip6_finish_output2+0x119c/0x14c0 net/ipv6/ip6_output.c:123
 dst_output include/net/dst.h:450 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ndisc_send_skb+0xa2f/0xf00 net/ipv6/ndisc.c:508
 addrconf_rs_timer+0x34d/0x7b0 net/ipv6/addrconf.c:3898
 call_timer_fn+0xf6/0x210 kernel/time/timer.c:1421
 expire_timers kernel/time/timer.c:1466 [inline]
 __run_timers+0x71a/0x910 kernel/time/timer.c:1734
 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747
 __do_softirq+0x392/0x7a3 kernel/softirq.c:558

The buggy address belongs to the object at ffff88807bf30800
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 2 bytes to the right of
 1024-byte region [ffff88807bf30800, ffff88807bf30c00)
The buggy address belongs to the page:
page:ffffea0001efcc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7bf30
head:ffffea0001efcc00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001dfc400 dead000000000003 ffff888011441dc0
raw: 0000000000000000 0000000080100010 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 19, ts 142199067122, free_ts 142194131289
 prep_new_page mm/page_alloc.c:2418 [inline]
 get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4149
 __alloc_pages+0x255/0x580 mm/page_alloc.c:5369
 alloc_slab_page mm/slub.c:1793 [inline]
 allocate_slab+0xcc/0x4d0 mm/slub.c:1930
 new_slab mm/slub.c:1993 [inline]
 ___slab_alloc+0x41e/0xc40 mm/slub.c:3022
 __slab_alloc mm/slub.c:3109 [inline]
 slab_alloc_node mm/slub.c:3200 [inline]
 __kmalloc_node_track_caller+0x2df/0x400 mm/slub.c:4956
 kmalloc_reserve net/core/skbuff.c:354 [inline]
 __alloc_skb+0x127/0x5a0 net/core/skbuff.c:426
 alloc_skb include/linux/skbuff.h:1126 [inline]
 __tcp_send_ack+0x98/0x5f0 net/ipv4/tcp_output.c:3930
 tcp_rcv_established+0x180d/0x22b0 net/ipv4/tcp_input.c:5912
 tcp_v4_do_rcv+0x3eb/0x950 net/ipv4/tcp_ipv4.c:1716
 tcp_v4_rcv+0x39db/0x4890 net/ipv4/tcp_ipv4.c:2110
 ip_protocol_deliver_rcu+0x1ed/0x3b0 net/ipv4/ip_input.c:204
 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline]
 NF_HOOK include/linux/netfilter.h:307 [inline]
 ip_local_deliver+0x316/0x490 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:460 [inline]
 ip_sublist_rcv_finish net/ipv4/ip_input.c:551 [inline]
 ip_list_rcv_finish net/ipv4/ip_input.c:601 [inline]
 ip_sublist_rcv+0xaab/0xb90 net/ipv4/ip_input.c:609
 ip_list_rcv+0x463/0x4b0 net/ipv4/ip_input.c:644
 __netif_receive_skb_list_ptype net/core/dev.c:5505 [inline]
 __netif_receive_skb_list_core+0x73e/0x950 net/core/dev.c:5553
 __netif_receive_skb_list+0x4b0/0x590 net/core/dev.c:5605
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1338 [inline]
 free_pcp_prepare+0xd1c/0xe00 mm/page_alloc.c:1389
 free_unref_page_prepare mm/page_alloc.c:3309 [inline]
 free_unref_page+0x7d/0x580 mm/page_alloc.c:3388
 skb_free_frag include/linux/skbuff.h:2949 [inline]
 skb_free_head net/core/skbuff.c:653 [inline]
 skb_release_data+0x3d2/0x4f0 net/core/skbuff.c:677
 skb_release_all net/core/skbuff.c:742 [inline]
 __kfree_skb+0x56/0x1d0 net/core/skbuff.c:756
 sk_eat_skb include/net/sock.h:2652 [inline]
 tcp_recvmsg_locked+0x15b4/0x29b0 net/ipv4/tcp.c:2488
 tcp_recvmsg+0x266/0x810 net/ipv4/tcp.c:2534
 inet_recvmsg+0x156/0x270 net/ipv4/af_inet.c:850
 sock_recvmsg_nosec net/socket.c:944 [inline]
 sock_recvmsg net/socket.c:962 [inline]
 sock_read_iter+0x3a7/0x4d0 net/socket.c:1035
 call_read_iter include/linux/fs.h:2156 [inline]
 new_sync_read fs/read_write.c:400 [inline]
 vfs_read+0xaf9/0xe60 fs/read_write.c:481
 ksys_read+0x18f/0x2c0 fs/read_write.c:619
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Memory state around the buggy address:
 ffff88807bf30b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88807bf30b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807bf30c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff88807bf30c80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88807bf30d00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-smack-root 2021/12/02 04:32 upstream 58e1100fdc59 61f86278 .config log report info KASAN: slab-out-of-bounds Read in udp6_set_csum
ci-upstream-kasan-gce-root 2021/11/18 21:04 upstream 42eb8fdac2fc 31a30fc0 .config log report info KASAN: slab-out-of-bounds Read in udp6_set_csum
ci-upstream-linux-next-kasan-gce-root 2021/11/27 23:08 linux-next f81e94e91878 63eeac02 .config log report info KASAN: slab-out-of-bounds Read in udp6_set_csum
* Struck through repros no longer work on HEAD.