syzbot


KASAN: use-after-free Read in ip6_finish_output2

Status: auto-closed as invalid on 2020/04/09 02:07
Subsystems: net
[Documentation on labels]
First crash: 1531d, last: 1531d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ip6_finish_output2+0x239a/0x25c0 net/ipv6/ip6_output.c:92
Read of size 8 at addr ffff8880927ad2d0 by task syz-executor.5/11197

CPU: 1 PID: 11197 Comm: syz-executor.5 Not tainted 5.5.0-next-20200207-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+0x197/0x210 lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374
 __kasan_report.cold+0x1b/0x32 mm/kasan/report.c:506
 kasan_report+0x12/0x20 mm/kasan/common.c:641
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135
 ip6_finish_output2+0x239a/0x25c0 net/ipv6/ip6_output.c:92
 __ip6_finish_output+0x444/0xaa0 net/ipv6/ip6_output.c:142
 ip6_finish_output+0x38/0x1f0 net/ipv6/ip6_output.c:152
 NF_HOOK_COND include/linux/netfilter.h:296 [inline]
 ip6_output+0x25e/0x880 net/ipv6/ip6_output.c:175
 dst_output include/net/dst.h:436 [inline]
 ip6_local_out+0xbb/0x1b0 net/ipv6/output_core.c:179
 ip6_send_skb+0xbb/0x350 net/ipv6/ip6_output.c:1795
 udp_v6_send_skb.isra.0+0x7bc/0x15d0 net/ipv6/udp.c:1172
 udpv6_sendmsg+0x230a/0x2b40 net/ipv6/udp.c:1470
 inet6_sendmsg+0x9e/0xe0 net/ipv6/af_inet6.c:576
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:672
 ____sys_sendmsg+0x358/0x880 net/socket.c:2343
 ___sys_sendmsg+0x100/0x170 net/socket.c:2397
 __sys_sendmmsg+0x1bf/0x4d0 net/socket.c:2487
 __do_sys_sendmmsg net/socket.c:2516 [inline]
 __se_sys_sendmmsg net/socket.c:2513 [inline]
 __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2513
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x45b399
Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f928e6a6c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007f928e6a76d4 RCX: 000000000045b399
RDX: 0000000000000066 RSI: 000000002000ac80 RDI: 0000000000000003
RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000
R10: 000000003f000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000008cc R14: 00000000004ca262 R15: 000000000075bfd4

Allocated by task 10218:
 save_stack+0x23/0x90 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 __kasan_kmalloc mm/kasan/common.c:515 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:488
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:529
 kmem_cache_alloc_trace+0x158/0x790 mm/slab.c:3551
 kmalloc include/linux/slab.h:555 [inline]
 kzalloc include/linux/slab.h:669 [inline]
 ipv6_add_dev net/ipv6/addrconf.c:373 [inline]
 ipv6_add_dev+0xd1/0x10b0 net/ipv6/addrconf.c:363
 ipv6_find_idev+0x17f/0x210 net/ipv6/addrconf.c:479
 inet6_rtm_newaddr+0x39c/0x15a0 net/ipv6/addrconf.c:4775
 rtnetlink_rcv_msg+0x45e/0xaf0 net/core/rtnetlink.c:5438
 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477
 rtnetlink_rcv+0x1d/0x30 net/core/rtnetlink.c:5456
 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
 netlink_unicast+0x59e/0x7e0 net/netlink/af_netlink.c:1328
 netlink_sendmsg+0x91c/0xea0 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:652 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:672
 __sys_sendto+0x262/0x380 net/socket.c:1998
 __do_sys_sendto net/socket.c:2010 [inline]
 __se_sys_sendto net/socket.c:2006 [inline]
 __x64_sys_sendto+0xe1/0x1a0 net/socket.c:2006
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 11223:
 save_stack+0x23/0x90 mm/kasan/common.c:72
 set_track mm/kasan/common.c:80 [inline]
 kasan_set_free_info mm/kasan/common.c:337 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:476
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:485
 __cache_free mm/slab.c:3426 [inline]
 kfree+0x10a/0x2c0 mm/slab.c:3757
 in6_dev_finish_destroy_rcu+0x8a/0xb0 net/ipv6/addrconf_core.c:234
 rcu_do_batch kernel/rcu/tree.c:2186 [inline]
 rcu_core+0x5e1/0x1390 kernel/rcu/tree.c:2410
 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2419
 __do_softirq+0x262/0x98c kernel/softirq.c:292

The buggy address belongs to the object at ffff8880927ad000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 720 bytes inside of
 1024-byte region [ffff8880927ad000, ffff8880927ad400)
The buggy address belongs to the page:
page:ffffea000249eb40 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0x0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea000240f388 ffffea00024fc1c8 ffff8880aa400c40
raw: 0000000000000000 ffff8880927ad000 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880927ad180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880927ad200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880927ad280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff8880927ad300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880927ad380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/02/09 01:58 linux-next 6dff1565d69c 06150bf1 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.