syzbot


KASAN: use-after-free Read in ip6_xmit

Status: fixed on 2018/05/09 07:47
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+56029fd3642567f395f0@syzkaller.appspotmail.com
Fix commit: c113187d38ff tls: Use correct sk->sk_prot for IPV6
First crash: 2332d, last: 2250d
Discussions (1)
Title Replies (including bot) Last reply
KASAN: use-after-free Read in ip6_xmit 1 (2) 2018/05/09 04:38
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-49 KASAN: use-after-free Read in ip6_xmit C 151 2090d 2314d 0/3 closed as invalid on 2019/01/29 20:22
android-44 KASAN: use-after-free Read in ip6_xmit C 137 2091d 2314d 0/2 closed as invalid on 2019/01/29 20:22

Sample crash report:
8021q: adding VLAN 0 to HW filter on device bond0
IPv6: ADDRCONF(NETDEV_UP): veth0: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
audit: type=1400 audit(1521114582.482:10): avc:  denied  { sys_chroot } for  pid=4233 comm="syzkaller448085" capability=18  scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tclass=cap_userns permissive=1
==================================================================
BUG: KASAN: use-after-free in ip6_dst_idev include/net/ip6_fib.h:192 [inline]
BUG: KASAN: use-after-free in ip6_xmit+0x1f76/0x2260 net/ipv6/ip6_output.c:264
Read of size 8 at addr ffff8801a998d818 by task syzkaller448085/4233

CPU: 1 PID: 4233 Comm: syzkaller448085 Not tainted 4.16.0-rc5+ #354
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 ip6_dst_idev include/net/ip6_fib.h:192 [inline]
 ip6_xmit+0x1f76/0x2260 net/ipv6/ip6_output.c:264
 inet6_csk_xmit+0x2fc/0x580 net/ipv6/inet6_connection_sock.c:139
 l2tp_xmit_core net/l2tp/l2tp_core.c:1053 [inline]
 l2tp_xmit_skb+0x105f/0x1410 net/l2tp/l2tp_core.c:1148
 pppol2tp_sendmsg+0x470/0x670 net/l2tp/l2tp_ppp.c:341
 sock_sendmsg_nosec net/socket.c:630 [inline]
 sock_sendmsg+0xca/0x110 net/socket.c:640
 ___sys_sendmsg+0x767/0x8b0 net/socket.c:2046
 __sys_sendmsg+0xe5/0x210 net/socket.c:2080
 SYSC_sendmsg net/socket.c:2091 [inline]
 SyS_sendmsg+0x2d/0x50 net/socket.c:2087
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441c59
RSP: 002b:00000000007dfea8 EFLAGS: 00000217 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 000000000000001a RCX: 0000000000441c59
RDX: 0000000000000081 RSI: 000000002037ffc8 RDI: 0000000000000004
RBP: 00000000004a3c86 R08: 0000000120080522 R09: 0000000120080522
R10: 0000000120080522 R11: 0000000000000217 R12: 00000000007dff70
R13: 0000000000402c90 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 4230:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3541
 dst_alloc+0x11f/0x1a0 net/core/dst.c:104
 rt_dst_alloc+0xe9/0x520 net/ipv4/route.c:1507
 __mkroute_output net/ipv4/route.c:2251 [inline]
 ip_route_output_key_hash_rcu+0xa59/0x2f00 net/ipv4/route.c:2479
 ip_route_output_key_hash+0x20b/0x370 net/ipv4/route.c:2308
 __ip_route_output_key include/net/route.h:125 [inline]
 ip_route_connect include/net/route.h:300 [inline]
 __ip4_datagram_connect+0xa67/0x1240 net/ipv4/datagram.c:51
 __ip6_datagram_connect+0x749/0x12d0 net/ipv6/datagram.c:157
 ip6_datagram_connect+0x2f/0x50 net/ipv6/datagram.c:273
 inet_dgram_connect+0x16b/0x1f0 net/ipv4/af_inet.c:542
 SYSC_connect+0x213/0x4a0 net/socket.c:1639
 SyS_connect+0x24/0x30 net/socket.c:1620
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 0:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
 __cache_free mm/slab.c:3485 [inline]
 kmem_cache_free+0x83/0x2a0 mm/slab.c:3743
 dst_destroy+0x257/0x370 net/core/dst.c:140
 dst_destroy_rcu+0x16/0x20 net/core/dst.c:153
 __rcu_reclaim kernel/rcu/rcu.h:172 [inline]
 rcu_do_batch kernel/rcu/tree.c:2674 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2933 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2900 [inline]
 rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2917
 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285

The buggy address belongs to the object at ffff8801a998d800
 which belongs to the cache ip_dst_cache of size 168
The buggy address is located 24 bytes inside of
 168-byte region [ffff8801a998d800, ffff8801a998d8a8)
The buggy address belongs to the page:
page:ffffea0006a66340 count:1 mapcount:0 mapping:ffff8801a998d000 index:0xffff8801a998d000
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801a998d000 ffff8801a998d000 0000000100000009
raw: ffff8801d588c638 ffffea0006c37060 ffff8801d5bae800 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801a998d700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801a998d780: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc
>ffff8801a998d800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8801a998d880: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc
 ffff8801a998d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (5174):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/03/15 11:51 upstream 0aa3fdb8b3a6 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/14 20:08 upstream 3032f8c504d2 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/14 04:53 upstream fc6eabbbf8ef 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/14 02:45 upstream fc6eabbbf8ef 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/13 17:48 upstream fc6eabbbf8ef 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/13 16:24 upstream fc6eabbbf8ef 08dacaa0 .config console log report syz C ci-upstream-kasan-gce
2018/03/12 10:35 upstream 0c8efd610b58 f505ca4b .config console log report syz C ci-upstream-kasan-gce
2018/03/12 03:00 upstream abeb75218aeb 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/11 14:28 upstream 3266b5bd97ea 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/11 09:31 upstream 3266b5bd97ea 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/11 09:07 upstream 3266b5bd97ea 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/10 20:35 upstream cdb06e9d8f52 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/10 04:40 upstream 719ea86151f3 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/09 06:42 upstream 1b88accf6a65 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/09 05:19 upstream 1b88accf6a65 36d1c454 .config console log report syz C ci-upstream-kasan-gce
2018/03/07 05:58 upstream ce380619fab9 c8a18476 .config console log report syz C ci-upstream-kasan-gce
2018/03/07 04:48 upstream ce380619fab9 c8a18476 .config console log report syz C ci-upstream-kasan-gce
2018/02/09 14:57 upstream f1517df8701c 9fb5ec43 .config console log report syz C ci-upstream-kasan-gce
2018/01/19 02:46 upstream dda3e15231b3 161c1d64 .config console log report syz C ci-upstream-kasan-gce
2017/12/31 17:19 upstream 71ee203389f7 00193447 .config console log report syz C ci-upstream-kasan-gce
2018/02/10 13:26 upstream 9a61df9e5f74 e67d44e0 .config console log report syz C ci-upstream-kasan-gce-386
2018/01/18 03:06 upstream 88dc7fca1800 b8970f31 .config console log report syz C ci-upstream-kasan-gce-386
2018/01/14 06:23 upstream 2c1cfa499018 c9e7aeae .config console log report syz C ci-upstream-kasan-gce-386
2018/01/20 08:04 net-next-old 43dd7512b51c fbbdcd92 .config console log report syz C ci-upstream-net-kasan-gce
2018/01/18 17:35 net-next-old 4f7d58517f46 56cc113a .config console log report syz C ci-upstream-net-kasan-gce
2018/03/15 11:07 net-next-old c292566a7779 08dacaa0 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/14 18:44 net-next-old a870a02cc963 08dacaa0 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/14 03:50 net-next-old be9fc0971a5c 08dacaa0 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/14 02:27 net-next-old be9fc0971a5c 08dacaa0 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/13 16:54 net-next-old 9ba32046fc2d 08dacaa0 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/12 09:58 net-next-old 8b4c6ed2ed0e 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/12 05:52 net-next-old 8b4c6ed2ed0e 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/12 03:08 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/11 14:55 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/11 14:04 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/11 12:22 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/11 08:49 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/10 04:54 net-next-old f44b1886a5f8 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/10 01:04 net-next-old cf29bded91f9 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/09 05:53 net-next-old fd372a7a9e5e 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/09 04:31 net-next-old fd372a7a9e5e 36d1c454 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/07 06:58 net-next-old 0f3e9c97eb5a c8a18476 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/07 05:43 net-next-old 0f3e9c97eb5a c8a18476 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/07 04:32 net-next-old 0f3e9c97eb5a c8a18476 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/07 02:58 net-next-old 0f3e9c97eb5a c8a18476 .config console log report syz C ci-upstream-net-kasan-gce
2018/03/06 21:51 net-next-old 0f3e9c97eb5a c8a18476 .config console log report syz C ci-upstream-net-kasan-gce
2018/01/27 22:11 net-next-old 6bb46bc57c8e 08146b1a .config console log report syz C ci-upstream-net-kasan-gce
2017/12/31 11:05 net-next-old 6bb8824732f6 bb6384b8 .config console log report syz C ci-upstream-net-kasan-gce
2018/01/20 08:17 mmots 216435561218 fbbdcd92 .config console log report syz C ci-upstream-mmots-kasan-gce
2018/01/18 12:27 linux-next a362f6d2cdbd 56cc113a .config console log report syz C ci-upstream-next-kasan-gce
2017/12/31 16:20 linux-next 0e08c463db38 00193447 .config console log report syz C ci-upstream-next-kasan-gce
2018/03/11 14:22 upstream 3266b5bd97ea 36d1c454 .config console log report syz ci-upstream-kasan-gce-386
2018/03/09 11:42 upstream 1b88accf6a65 36d1c454 .config console log report syz ci-upstream-kasan-gce-386
2018/03/09 07:10 upstream 1b88accf6a65 36d1c454 .config console log report syz ci-upstream-kasan-gce-386
2018/03/09 05:04 upstream 1b88accf6a65 36d1c454 .config console log report syz ci-upstream-kasan-gce-386
2018/03/07 08:01 upstream ce380619fab9 c8a18476 .config console log report syz ci-upstream-kasan-gce-386
2018/03/07 05:58 upstream ce380619fab9 c8a18476 .config console log report syz ci-upstream-kasan-gce-386
2018/03/07 04:48 upstream ce380619fab9 c8a18476 .config console log report syz ci-upstream-kasan-gce-386
2018/03/06 22:11 upstream ce380619fab9 c8a18476 .config console log report syz ci-upstream-kasan-gce-386
2018/03/06 20:40 upstream ce380619fab9 c8a18476 .config console log report syz ci-upstream-kasan-gce-386
2018/03/22 11:33 upstream 3215b9d57a2c 95c88d7a .config console log report ci-upstream-kasan-gce
2018/03/22 03:54 upstream 3215b9d57a2c 95c88d7a .config console log report ci-upstream-kasan-gce
2018/03/20 15:33 upstream 1b5f3ba415fe 72c33b66 .config console log report ci-upstream-kasan-gce
2018/03/19 17:59 upstream c698ca527893 7e7d7ed2 .config console log report ci-upstream-kasan-gce
2018/03/16 22:23 upstream df09348f78dc 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/13 10:23 upstream fc6eabbbf8ef 08dacaa0 .config console log report ci-upstream-kasan-gce
2018/03/12 19:54 upstream 0c8efd610b58 f505ca4b .config console log report ci-upstream-kasan-gce
2018/03/10 17:14 upstream cdb06e9d8f52 36d1c454 .config console log report ci-upstream-kasan-gce
2018/03/08 14:27 upstream 1b88accf6a65 acd0caa5 .config console log report ci-upstream-kasan-gce
2018/03/20 21:15 upstream 1b5f3ba415fe 72c33b66 .config console log report ci-upstream-kasan-gce-386
2018/03/18 06:07 upstream 8f5fd927c3a7 08dacaa0 .config console log report ci-upstream-kasan-gce-386
2018/03/13 02:35 upstream fc6eabbbf8ef f505ca4b .config console log report ci-upstream-kasan-gce-386
2018/03/10 00:01 upstream 719ea86151f3 36d1c454 .config console log report ci-upstream-kasan-gce-386
2018/03/08 19:50 upstream 1b88accf6a65 acd0caa5 .config console log report ci-upstream-kasan-gce-386
2018/03/23 04:43 net-next-old aa65f6365405 2e9d9054 .config console log report ci-upstream-net-kasan-gce
2018/03/22 19:05 net-next-old aa65f6365405 2e9d9054 .config console log report ci-upstream-net-kasan-gce
2018/03/21 23:04 net-next-old 454bfe97837a f63eeee9 .config console log report ci-upstream-net-kasan-gce
2018/03/21 20:25 net-next-old 454bfe97837a f63eeee9 .config console log report ci-upstream-net-kasan-gce
2018/03/20 19:09 net-next-old c846d8da5640 72c33b66 .config console log report ci-upstream-net-kasan-gce
2018/03/20 17:03 net-next-old c846d8da5640 72c33b66 .config console log report ci-upstream-net-kasan-gce
2018/03/20 12:56 net-next-old c314c7ba4038 72c33b66 .config console log report ci-upstream-net-kasan-gce
2018/03/20 01:33 net-next-old c314c7ba4038 7e7d7ed2 .config console log report ci-upstream-net-kasan-gce
2018/03/19 19:17 net-next-old e3c72f3d37e4 7e7d7ed2 .config console log report ci-upstream-net-kasan-gce
2018/03/19 13:43 net-next-old e3c72f3d37e4 7e7d7ed2 .config console log report ci-upstream-net-kasan-gce
2018/03/19 08:28 net-next-old e3c72f3d37e4 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/19 05:52 net-next-old e3c72f3d37e4 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/18 20:04 net-next-old 76f38f1f3cf8 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/18 03:09 net-next-old d7cb44496a9b 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/17 20:48 net-next-old 53794570049d 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/17 16:54 net-next-old 53794570049d 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/17 14:42 net-next-old 53794570049d 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/17 05:13 net-next-old 53794570049d 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/17 03:00 net-next-old 53794570049d 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/15 05:00 net-next-old c292566a7779 08dacaa0 .config console log report ci-upstream-net-kasan-gce
2018/03/13 05:45 net-next-old 9ba32046fc2d f505ca4b .config console log report ci-upstream-net-kasan-gce
2018/03/12 22:09 net-next-old 129cf5f7f196 f505ca4b .config console log report ci-upstream-net-kasan-gce
2018/03/12 21:06 net-next-old 129cf5f7f196 f505ca4b .config console log report ci-upstream-net-kasan-gce
2018/03/12 17:41 net-next-old 129cf5f7f196 f505ca4b .config console log report ci-upstream-net-kasan-gce
2018/03/10 17:15 net-next-old f44b1886a5f8 36d1c454 .config console log report ci-upstream-net-kasan-gce
2018/03/10 11:46 net-next-old f44b1886a5f8 36d1c454 .config console log report ci-upstream-net-kasan-gce
2018/03/09 16:42 net-next-old cf29bded91f9 36d1c454 .config console log report ci-upstream-net-kasan-gce
2018/03/09 03:00 net-next-old fd372a7a9e5e 36d1c454 .config console log report ci-upstream-net-kasan-gce
2018/03/08 20:56 net-next-old 67ae686b3e14 acd0caa5 .config console log report ci-upstream-net-kasan-gce
2018/03/08 12:50 net-next-old a366e300ae9f acd0caa5 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.