syzbot


KASAN: use-after-free Read in ip6_route_mpath_notify

Status: public: reported C repro on 2019/04/11 00:00
Reported-by: syzbot+bb378a1032f94b28f89b@syzkaller.appspotmail.com
First crash: 2277d, last: 2250d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ip6_route_mpath_notify net C 25 2362d 2367d 8/28 fixed on 2018/07/09 18:05

Sample crash report:
IPv6: NLM_F_CREATE should be set when creating new route
IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE
IPv6: NLM_F_CREATE should be set when creating new route
IPv6: RTM_NEWROUTE with no NLM_F_CREATE or NLM_F_REPLACE
==================================================================
BUG: KASAN: use-after-free in ip6_route_mpath_notify+0xc2/0xd0 net/ipv6/route.c:3131
Read of size 4 at addr ffff8801bf6707d0 by task syz-executor080/1972

CPU: 0 PID: 1972 Comm: syz-executor080 Not tainted 4.14.67+ #2
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0xb9/0x11b lib/dump_stack.c:53
 print_address_description+0x60/0x22b mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409
 ip6_route_mpath_notify+0xc2/0xd0 net/ipv6/route.c:3131
 ip6_route_multipath_add+0xbfc/0x1100 net/ipv6/route.c:3251
 inet6_rtm_newroute+0xa4/0x110 net/ipv6/route.c:3339
 rtnetlink_rcv_msg+0x3bb/0xb30 net/core/rtnetlink.c:4255
 netlink_rcv_skb+0x130/0x390 net/netlink/af_netlink.c:2432
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x46d/0x620 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x664/0xbe0 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:645 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:655
 ___sys_sendmsg+0x741/0x890 net/socket.c:2061
 __sys_sendmsg+0xca/0x170 net/socket.c:2095
 SYSC_sendmsg net/socket.c:2106 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2102
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440e19
RSP: 002b:00007ffdb6627228 EFLAGS: 00000213 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000440e19
RDX: 0000000000000000 RSI: 0000000020000600 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000001f65880 R11: 0000000000000213 R12: 0000000000007ffc
R13: 0000000000401df0 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 1972:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551
 slab_post_alloc_hook mm/slab.h:442 [inline]
 slab_alloc_node mm/slub.c:2723 [inline]
 slab_alloc mm/slub.c:2731 [inline]
 kmem_cache_alloc+0xe4/0x2b0 mm/slub.c:2736
 dst_alloc+0xb1/0x1a0 net/core/dst.c:107
 __ip6_dst_alloc+0x2f/0x60 net/ipv6/route.c:355
 ip6_dst_alloc+0x2a/0x1d0 net/ipv6/route.c:368
 ip6_route_info_create+0x339/0x23d0 net/ipv6/route.c:1953
 ip6_route_multipath_add+0x60b/0x1100 net/ipv6/route.c:3190
 inet6_rtm_newroute+0xa4/0x110 net/ipv6/route.c:3339
 rtnetlink_rcv_msg+0x3bb/0xb30 net/core/rtnetlink.c:4255
 netlink_rcv_skb+0x130/0x390 net/netlink/af_netlink.c:2432
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x46d/0x620 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x664/0xbe0 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:645 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:655
 ___sys_sendmsg+0x741/0x890 net/socket.c:2061
 __sys_sendmsg+0xca/0x170 net/socket.c:2095
 SYSC_sendmsg net/socket.c:2106 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2102
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 1972:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524
 slab_free_hook mm/slub.c:1389 [inline]
 slab_free_freelist_hook mm/slub.c:1410 [inline]
 slab_free mm/slub.c:2966 [inline]
 kmem_cache_free+0x12d/0x350 mm/slub.c:2988
 dst_destroy+0x1c7/0x2c0 net/core/dst.c:138
 dst_release_immediate+0x45/0x60 net/core/dst.c:203
 fib6_add+0x18c5/0x2c30 net/ipv6/ip6_fib.c:1233
 __ip6_ins_rt+0x61/0x80 net/ipv6/route.c:945
 ip6_route_multipath_add+0xb1c/0x1100 net/ipv6/route.c:3215
 inet6_rtm_newroute+0xa4/0x110 net/ipv6/route.c:3339
 rtnetlink_rcv_msg+0x3bb/0xb30 net/core/rtnetlink.c:4255
 netlink_rcv_skb+0x130/0x390 net/netlink/af_netlink.c:2432
 netlink_unicast_kernel net/netlink/af_netlink.c:1286 [inline]
 netlink_unicast+0x46d/0x620 net/netlink/af_netlink.c:1312
 netlink_sendmsg+0x664/0xbe0 net/netlink/af_netlink.c:1877
 sock_sendmsg_nosec net/socket.c:645 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:655
 ___sys_sendmsg+0x741/0x890 net/socket.c:2061
 __sys_sendmsg+0xca/0x170 net/socket.c:2095
 SYSC_sendmsg net/socket.c:2106 [inline]
 SyS_sendmsg+0x27/0x40 net/socket.c:2102
 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8801bf670700
 which belongs to the cache ip6_dst_cache of size 384
The buggy address is located 208 bytes inside of
 384-byte region [ffff8801bf670700, ffff8801bf670880)
The buggy address belongs to the page:
page:ffffea0006fd9c00 count:1 mapcount:0 mapping:          (null) index:0x0 compound_mapcount: 0
flags: 0x4000000000008100(slab|head)
raw: 4000000000008100 0000000000000000 0000000000000000 0000000180120012
raw: dead000000000100 dead000000000200 ffff8801d52d6a00 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801bf670680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
 ffff8801bf670700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801bf670780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff8801bf670800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801bf670880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (92):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/09/05 07:19 android-4.14 e9a6a1abd019 a4718693 .config console log report syz C ci-android-414-kasan-gce-root
2018/09/05 06:14 android-4.14 e9a6a1abd019 a4718693 .config console log report syz C ci-android-414-kasan-gce-root
2018/09/26 07:11 android-4.14 666c420fa3ea b7e11289 .config console log report ci-android-414-kasan-gce-root
2018/09/26 05:56 android-4.14 666c420fa3ea b7e11289 .config console log report ci-android-414-kasan-gce-root
2018/09/26 02:22 android-4.14 666c420fa3ea b7e11289 .config console log report ci-android-414-kasan-gce-root
2018/09/25 22:41 android-4.14 666c420fa3ea b7e11289 .config console log report ci-android-414-kasan-gce-root
2018/09/25 20:33 android-4.14 666c420fa3ea b7e11289 .config console log report ci-android-414-kasan-gce-root
2018/09/25 17:59 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/25 16:17 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/25 12:18 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/25 10:16 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/25 09:20 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/25 02:19 android-4.14 666c420fa3ea 0e7547d7 .config console log report ci-android-414-kasan-gce-root
2018/09/24 06:39 android-4.14 666c420fa3ea 28d9ac76 .config console log report ci-android-414-kasan-gce-root
2018/09/24 01:32 android-4.14 666c420fa3ea 28d9ac76 .config console log report ci-android-414-kasan-gce-root
2018/09/23 20:15 android-4.14 666c420fa3ea 28d9ac76 .config console log report ci-android-414-kasan-gce-root
2018/09/23 15:30 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/23 12:29 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/23 11:21 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/23 05:52 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/23 01:50 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 21:37 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 15:44 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 14:09 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 08:26 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 06:21 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/22 04:52 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/21 15:21 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/21 14:27 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/21 11:16 android-4.14 666c420fa3ea 37079712 .config console log report ci-android-414-kasan-gce-root
2018/09/17 10:52 android-4.14 f8223ece3a67 7f125108 .config console log report ci-android-414-kasan-gce-root
2018/09/09 10:58 android-4.14 b859aa7d7a0c 6b5120a4 .config console log report ci-android-414-kasan-gce-root
2018/09/09 06:25 android-4.14 b859aa7d7a0c 6b5120a4 .config console log report ci-android-414-kasan-gce-root
2018/09/08 23:10 android-4.14 b859aa7d7a0c 6b5120a4 .config console log report ci-android-414-kasan-gce-root
2018/09/08 07:56 android-4.14 b859aa7d7a0c 6b5120a4 .config console log report ci-android-414-kasan-gce-root
2018/09/08 00:35 android-4.14 b859aa7d7a0c 69cfeb80 .config console log report ci-android-414-kasan-gce-root
2018/09/07 10:48 android-4.14 b859aa7d7a0c e30d3b52 .config console log report ci-android-414-kasan-gce-root
2018/09/07 08:10 android-4.14 b859aa7d7a0c e30d3b52 .config console log report ci-android-414-kasan-gce-root
2018/09/07 05:10 android-4.14 b859aa7d7a0c e30d3b52 .config console log report ci-android-414-kasan-gce-root
2018/09/06 18:12 android-4.14 b859aa7d7a0c 0bb7a7eb .config console log report ci-android-414-kasan-gce-root
2018/09/05 21:03 android-4.14 36b4801b9aad 196410e4 .config console log report ci-android-414-kasan-gce-root
2018/09/05 18:51 android-4.14 36b4801b9aad 196410e4 .config console log report ci-android-414-kasan-gce-root
2018/09/05 16:11 android-4.14 36b4801b9aad 196410e4 .config console log report ci-android-414-kasan-gce-root
2018/09/05 13:04 android-4.14 36b4801b9aad 196410e4 .config console log report ci-android-414-kasan-gce-root
2018/09/05 09:36 android-4.14 36b4801b9aad a4718693 .config console log report ci-android-414-kasan-gce-root
2018/09/04 19:27 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
2018/09/04 18:27 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
2018/09/04 13:29 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
2018/09/04 13:07 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
2018/09/04 10:42 android-4.14 47350a9f13c6 a4718693 .config console log report ci-android-414-kasan-gce-root
2018/08/30 03:50 android-4.14 47350a9f13c6 6c7e9d3d .config console log report ci-android-414-kasan-gce-root
* Struck through repros no longer work on HEAD.