syzbot


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

Status: auto-closed as invalid on 2019/10/25 08:36
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+ec03ae3a032901d10434@syzkaller.appspotmail.com
First crash: 1935d, last: 1775d
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 99 open syzbot bugs in net subsystem 14 (14) 2019/07/31 15:13
Reminder: 94 open syzbot bugs in net subsystem 1 (1) 2019/06/25 05:48
KASAN: slab-out-of-bounds Read in ip6_hold_safe 0 (1) 2019/02/21 14:47

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
BUG: KASAN: slab-out-of-bounds in atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
BUG: KASAN: slab-out-of-bounds in dst_hold_safe include/net/dst.h:297 [inline]
BUG: KASAN: slab-out-of-bounds in ip6_hold_safe+0xad/0x380 net/ipv6/route.c:1046
Read of size 4 at addr ffff88808a3cd2bf by task syz-executor.0/28994

CPU: 1 PID: 28994 Comm: syz-executor.0 Not tainted 5.2.0-rc4+ #52
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+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x123/0x190 mm/kasan/generic.c:191
 kasan_check_read+0x11/0x20 mm/kasan/common.c:94
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
 atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
 atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
 dst_hold_safe include/net/dst.h:297 [inline]
 ip6_hold_safe+0xad/0x380 net/ipv6/route.c:1046
 rt6_get_pcpu_route net/ipv6/route.c:1273 [inline]
 ip6_pol_route+0x339/0x1050 net/ipv6/route.c:1952
 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2128
 fib6_rule_lookup+0x133/0x5a0 net/ipv6/fib6_rules.c:113
 ip6_route_output_flags+0x2c4/0x350 net/ipv6/route.c:2157
 ip6_route_output include/net/ip6_route.h:89 [inline]
 ip6_dst_lookup_tail+0xd10/0x1b30 net/ipv6/ip6_output.c:962
 ip6_dst_lookup_flow+0xa8/0x220 net/ipv6/ip6_output.c:1090
 sctp_v6_get_dst+0x785/0x1ce0 net/sctp/ipv6.c:278
 sctp_transport_route+0x12d/0x360 net/sctp/transport.c:297
 sctp_assoc_add_peer+0x53e/0xfc0 net/sctp/associola.c:663
 sctp_process_param net/sctp/sm_make_chunk.c:2522 [inline]
 sctp_process_init+0x2458/0x2ad0 net/sctp/sm_make_chunk.c:2343
 sctp_sf_do_unexpected_init net/sctp/sm_statefuns.c:1541 [inline]
 sctp_sf_do_unexpected_init.isra.0+0x7cd/0x1350 net/sctp/sm_statefuns.c:1441
 sctp_sf_do_5_2_1_siminit+0x35/0x40 net/sctp/sm_statefuns.c:1670
 sctp_do_sm+0x121/0x5190 net/sctp/sm_sideeffect.c:1152
 sctp_assoc_bh_rcv+0x343/0x660 net/sctp/associola.c:1059
 sctp_inq_push+0x1e4/0x280 net/sctp/inqueue.c:80
 sctp_backlog_rcv+0x196/0xbe0 net/sctp/input.c:339
 sk_backlog_rcv include/net/sock.h:945 [inline]
 __release_sock+0x129/0x390 net/core/sock.c:2412
 release_sock+0x59/0x1c0 net/core/sock.c:2928
 sctp_wait_for_connect+0x316/0x540 net/sctp/socket.c:9039
 __sctp_connect+0xab2/0xcd0 net/sctp/socket.c:1226
 sctp_connect net/sctp/socket.c:4846 [inline]
 sctp_inet_connect+0x29c/0x340 net/sctp/socket.c:4862
 __sys_connect+0x264/0x330 net/socket.c:1834
 __do_sys_connect net/socket.c:1845 [inline]
 __se_sys_connect net/socket.c:1842 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1842
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4592c9
Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb874a5ec78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004592c9
RDX: 000000000000001c RSI: 0000000020000080 RDI: 0000000000000004
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb874a5f6d4
R13: 00000000004bf7b5 R14: 00000000004d0f38 R15: 00000000ffffffff

Allocated by task 14692:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497
 slab_post_alloc_hook mm/slab.h:437 [inline]
 slab_alloc mm/slab.c:3326 [inline]
 kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488
 dst_alloc+0x10e/0x200 net/core/dst.c:93
 ip6_dst_alloc+0x34/0xa0 net/ipv6/route.c:352
 ip6_rt_pcpu_alloc net/ipv6/route.c:1253 [inline]
 rt6_make_pcpu_route net/ipv6/route.c:1283 [inline]
 ip6_pol_route+0x659/0x1050 net/ipv6/route.c:1955
 ip6_pol_route_input+0x65/0x80 net/ipv6/route.c:1971
 fib6_rule_lookup+0x133/0x5a0 net/ipv6/fib6_rules.c:113
 ip6_route_input_lookup+0xb7/0xd0 net/ipv6/route.c:1983
 ip6_route_input+0x5e2/0x9e0 net/ipv6/route.c:2118
 ip6_rcv_finish_core.isra.0+0x174/0x590 net/ipv6/ip6_input.c:63
 ip6_rcv_finish+0x17a/0x310 net/ipv6/ip6_input.c:74
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:272
 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:4981
 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5095
 netif_receive_skb_internal+0x108/0x390 net/core/dev.c:5185
 netif_receive_skb+0x6e/0x5a0 net/core/dev.c:5244
 tun_rx_batched.isra.0+0x4f7/0x840 drivers/net/tun.c:1562
 tun_get_user+0x1482/0x3ff0 drivers/net/tun.c:1999
 tun_chr_write_iter+0xbd/0x156 drivers/net/tun.c:2028
 call_write_iter include/linux/fs.h:1872 [inline]
 do_iter_readv_writev+0x5f8/0x8f0 fs/read_write.c:693
 do_iter_write fs/read_write.c:970 [inline]
 do_iter_write+0x184/0x610 fs/read_write.c:951
 vfs_writev+0x1b3/0x2f0 fs/read_write.c:1015
 do_writev+0x15b/0x330 fs/read_write.c:1058
 __do_sys_writev fs/read_write.c:1131 [inline]
 __se_sys_writev fs/read_write.c:1128 [inline]
 __x64_sys_writev+0x75/0xb0 fs/read_write.c:1128
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 13779:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3698
 dst_destroy+0x29e/0x3c0 net/core/dst.c:129
 dst_destroy_rcu+0x16/0x19 net/core/dst.c:142
 __rcu_reclaim kernel/rcu/rcu.h:222 [inline]
 rcu_do_batch kernel/rcu/tree.c:2092 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline]
 rcu_core+0xba5/0x1500 kernel/rcu/tree.c:2291
 __do_softirq+0x25c/0x94c kernel/softirq.c:292

The buggy address belongs to the object at ffff88808a3cd1c0
 which belongs to the cache ip6_dst_cache of size 224
The buggy address is located 31 bytes to the right of
 224-byte region [ffff88808a3cd1c0, ffff88808a3cd2a0)
The buggy address belongs to the page:
page:ffffea000228f340 refcount:1 mapcount:0 mapping:ffff8882164179c0 index:0xffff88808a3cdbc0
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea0002559c48 ffff88809b655d38 ffff8882164179c0
raw: ffff88808a3cdbc0 ffff88808a3cd080 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808a3cd180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
 ffff88808a3cd200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88808a3cd280: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc
                                        ^
 ffff88808a3cd300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808a3cd380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (35):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/16 05:41 upstream e01e060fe00d 442206d7 .config console log report ci-upstream-kasan-gce
2019/03/05 02:31 upstream 736706bee329 7c693b52 .config console log report ci-upstream-kasan-gce
2019/02/25 05:58 upstream c3619a482e15 7a06e792 .config console log report ci-upstream-kasan-gce-smack-root
2019/06/07 15:07 upstream 16d72dd4891f ce9107d0 .config console log report ci-upstream-kasan-gce-386
2019/02/26 23:28 upstream 7d762d69145a f2468c12 .config console log report ci-upstream-kasan-gce-386
2019/06/14 15:19 net-old b8003cef2e63 998ccc76 .config console log report ci-upstream-net-this-kasan-gce
2019/05/27 02:07 net-old 334031219a84 85c57315 .config console log report ci-upstream-net-this-kasan-gce
2019/05/26 14:20 net-old f4bcf14e3997 85c57315 .config console log report ci-upstream-net-this-kasan-gce
2019/05/25 01:24 net-old ce8d24f9a596 85c57315 .config console log report ci-upstream-net-this-kasan-gce
2019/05/04 04:33 net-old 93aa4792c390 d28f4ce5 .config console log report ci-upstream-net-this-kasan-gce
2019/04/28 04:41 net-old b2a20fd0725e b617407b .config console log report ci-upstream-net-this-kasan-gce
2019/04/24 04:44 net-old d04830531d0c 4d3d6a50 .config console log report ci-upstream-net-this-kasan-gce
2019/04/12 20:00 net-old e30584509659 8916f5e1 .config console log report ci-upstream-net-this-kasan-gce
2019/04/04 10:57 net-old ef0efcd3bd3f 6a475fff .config console log report ci-upstream-net-this-kasan-gce
2019/03/30 17:12 net-old 4d31c4fa3f9e c35ee0ea .config console log report ci-upstream-net-this-kasan-gce
2019/03/30 09:41 net-old 4d31c4fa3f9e c35ee0ea .config console log report ci-upstream-net-this-kasan-gce
2019/03/04 15:55 net-old 822e44b45eb9 7c693b52 .config console log report ci-upstream-net-this-kasan-gce
2019/06/15 22:28 net-next-old 877cd9ffbc9c 442206d7 .config console log report ci-upstream-net-kasan-gce
2019/06/15 00:34 net-next-old 733f0766c3de 442206d7 .config console log report ci-upstream-net-kasan-gce
2019/06/11 03:36 net-next-old a248384e6420 0159583c .config console log report ci-upstream-net-kasan-gce
2019/06/10 09:53 net-next-old ad3a9ee0b623 0159583c .config console log report ci-upstream-net-kasan-gce
2019/06/10 09:51 net-next-old ad3a9ee0b623 0159583c .config console log report ci-upstream-net-kasan-gce
2019/06/07 19:28 net-next-old 96524ea4be04 ce9107d0 .config console log report ci-upstream-net-kasan-gce
2019/06/07 11:01 net-next-old 96524ea4be04 b004e95a .config console log report ci-upstream-net-kasan-gce
2019/06/07 07:37 net-next-old 4daa95af7f1c 698773cb .config console log report ci-upstream-net-kasan-gce
2019/06/05 13:00 net-next-old 712246bc93cb bfb4a51e .config console log report ci-upstream-net-kasan-gce
2019/05/31 10:55 net-next-old 517f4c49aafc d9aaf3c2 .config console log report ci-upstream-net-kasan-gce
2019/05/29 17:10 net-next-old 36f18439ea16 5457ef34 .config console log report ci-upstream-net-kasan-gce
2019/03/11 11:02 net-next-old d9862cfbe209 12365b99 .config console log report ci-upstream-net-kasan-gce
2019/03/09 03:18 net-next-old d9862cfbe209 12365b99 .config console log report ci-upstream-net-kasan-gce
2019/03/02 19:29 net-next-old 9bfc445e0eec 1c0e457a .config console log report ci-upstream-net-kasan-gce
2019/02/18 01:39 net-next-old f186a82b10dc 3e98cc30 .config console log report ci-upstream-net-kasan-gce
2019/01/30 19:44 net-next-old eaf2a47f40f0 aa432daf .config console log report ci-upstream-net-kasan-gce
2019/01/09 23:54 net-next-old b71acb0e3721 45c0c1b1 .config console log report ci-upstream-net-kasan-gce
2019/01/07 06:11 net-next-old b71acb0e3721 ee332608 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.