syzbot


KMSAN: uninit-value in inet_getpeer

Status: fixed on 2018/05/08 18:30
Reported-by: syzbot+@syzkaller.appspotmail.com
Fix commit: b6a37e5e2541 inetpeer: fix uninit-value in inet_getpeer
First crash: 1631d, last: 1602d

Sample crash report:
IPv6: ADDRCONF(NETDEV_UP): veth1: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): veth0: link becomes ready
==================================================================
BUG: KMSAN: uninit-value in inet_peer_gc net/ipv4/inetpeer.c:163 [inline]
BUG: KMSAN: uninit-value in inet_getpeer+0x1567/0x1e70 net/ipv4/inetpeer.c:228
CPU: 0 PID: 3575 Comm: syzkaller242190 Not tainted 4.16.0+ #83
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+0x185/0x1d0 lib/dump_stack.c:53
 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067
 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:676
 inet_peer_gc net/ipv4/inetpeer.c:163 [inline]
 inet_getpeer+0x1567/0x1e70 net/ipv4/inetpeer.c:228
 inet_getpeer_v4 include/net/inetpeer.h:110 [inline]
 icmpv4_xrlim_allow net/ipv4/icmp.c:330 [inline]
 icmp_send+0x2b44/0x3050 net/ipv4/icmp.c:725
 ip_options_compile+0x237c/0x29f0 net/ipv4/ip_options.c:472
 ip_rcv_options net/ipv4/ip_input.c:284 [inline]
 ip_rcv_finish+0xda8/0x16d0 net/ipv4/ip_input.c:365
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x119d/0x16f0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47cf/0x4a80 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 netif_receive_skb_internal+0x49d/0x630 net/core/dev.c:4701
 napi_frags_finish net/core/dev.c:5142 [inline]
 napi_gro_frags+0xf43/0x15b0 net/core/dev.c:5215
 tun_get_user+0x4ed5/0x7580 drivers/net/tun.c:1945
 tun_chr_write_iter+0x1d4/0x330 drivers/net/tun.c:1990
 do_iter_readv_writev+0x7bb/0x970 include/linux/fs.h:1776
 do_iter_write+0x30d/0xd40 fs/read_write.c:932
 vfs_writev fs/read_write.c:977 [inline]
 do_writev+0x3c9/0x830 fs/read_write.c:1012
 SYSC_writev+0x9b/0xb0 fs/read_write.c:1085
 SyS_writev+0x56/0x80 fs/read_write.c:1082
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
RIP: 0033:0x4418b0
RSP: 002b:00007ffd96af47e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 000000000000001b RCX: 00000000004418b0
RDX: 0000000000000001 RSI: 00007ffd96af47f0 RDI: 00000000000000fc
RBP: 00000000004a3589 R08: 0000000020000040 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd96af4968
R13: 0000000000402700 R14: 0000000000000000 R15: 0000000000000000

Uninit was created at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188
 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314
 kmem_cache_alloc+0xaab/0xb90 mm/slub.c:2756
 inet_getpeer+0xed8/0x1e70 net/ipv4/inetpeer.c:210
 inet_getpeer_v4 include/net/inetpeer.h:110 [inline]
 ip4_frag_init+0x4d1/0x740 net/ipv4/ip_fragment.c:153
 inet_frag_alloc net/ipv4/inet_fragment.c:369 [inline]
 inet_frag_create net/ipv4/inet_fragment.c:385 [inline]
 inet_frag_find+0x7da/0x1610 net/ipv4/inet_fragment.c:418
 ip_find net/ipv4/ip_fragment.c:275 [inline]
 ip_defrag+0x448/0x67a0 net/ipv4/ip_fragment.c:676
 ip_local_deliver+0x18f/0x4e0 net/ipv4/ip_input.c:253
 dst_input include/net/dst.h:449 [inline]
 ip_rcv_finish+0x1253/0x16d0 net/ipv4/ip_input.c:397
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x119d/0x16f0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47cf/0x4a80 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 netif_receive_skb_internal+0x49d/0x630 net/core/dev.c:4701
 napi_frags_finish net/core/dev.c:5142 [inline]
 napi_gro_frags+0xf43/0x15b0 net/core/dev.c:5215
 tun_get_user+0x4ed5/0x7580 drivers/net/tun.c:1945
 tun_chr_write_iter+0x1d4/0x330 drivers/net/tun.c:1990
 do_iter_readv_writev+0x7bb/0x970 include/linux/fs.h:1776
 do_iter_write+0x30d/0xd40 fs/read_write.c:932
 vfs_writev fs/read_write.c:977 [inline]
 do_writev+0x3c9/0x830 fs/read_write.c:1012
 SYSC_writev+0x9b/0xb0 fs/read_write.c:1085
 SyS_writev+0x56/0x80 fs/read_write.c:1082
 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x3d/0xa2
==================================================================

Crashes (54):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kmsan-gce 2018/04/12 19:01 https://github.com/google/kmsan.git master 35ff515e4bda eb2295de .config log report syz C
ci-upstream-kmsan-gce 2018/05/08 14:24 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config log report
ci-upstream-kmsan-gce 2018/05/08 08:48 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config log report
ci-upstream-kmsan-gce 2018/05/07 13:12 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config log report
ci-upstream-kmsan-gce 2018/05/07 08:11 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config log report
ci-upstream-kmsan-gce 2018/05/07 02:17 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config log report
ci-upstream-kmsan-gce 2018/05/05 22:31 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config log report
ci-upstream-kmsan-gce 2018/05/05 00:08 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/04 20:30 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/04 05:42 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/03 23:47 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/03 19:47 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/03 12:32 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/03 06:38 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config log report
ci-upstream-kmsan-gce 2018/05/02 22:58 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/02 21:48 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/02 12:36 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/02 08:03 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/02 01:59 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 22:49 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 13:50 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 11:32 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 10:43 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 09:03 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 07:49 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/05/01 03:08 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/04/30 20:48 https://github.com/google/kmsan.git master d2d741e5d189 d5b114b4 .config log report
ci-upstream-kmsan-gce 2018/04/29 19:01 https://github.com/google/kmsan.git master d2d741e5d189 bb79c6ab .config log report
ci-upstream-kmsan-gce 2018/04/29 16:36 https://github.com/google/kmsan.git master d2d741e5d189 d5a5d045 .config log report
ci-upstream-kmsan-gce 2018/04/29 03:13 https://github.com/google/kmsan.git master d2d741e5d189 d5a5d045 .config log report
ci-upstream-kmsan-gce 2018/04/29 01:04 https://github.com/google/kmsan.git master d2d741e5d189 d5a5d045 .config log report
ci-upstream-kmsan-gce 2018/04/28 23:21 https://github.com/google/kmsan.git master d2d741e5d189 d5a5d045 .config log report
ci-upstream-kmsan-gce 2018/04/28 02:12 https://github.com/google/kmsan.git master d2d741e5d189 d5a5d045 .config log report
ci-upstream-kmsan-gce 2018/04/26 08:26 https://github.com/google/kmsan.git master d2d741e5d189 73417389 .config log report
ci-upstream-kmsan-gce 2018/04/24 04:13 https://github.com/google/kmsan.git master d2d741e5d189 e7e85d36 .config log report
ci-upstream-kmsan-gce 2018/04/24 03:10 https://github.com/google/kmsan.git master d2d741e5d189 e7e85d36 .config log report
ci-upstream-kmsan-gce 2018/04/23 14:25 https://github.com/google/kmsan.git master d2d741e5d189 20941ab3 .config log report
ci-upstream-kmsan-gce 2018/04/23 10:35 https://github.com/google/kmsan.git master d2d741e5d189 20941ab3 .config log report
ci-upstream-kmsan-gce 2018/04/22 16:13 https://github.com/google/kmsan.git master d2d741e5d189 d23fcf6c .config log report
ci-upstream-kmsan-gce 2018/04/21 07:36 https://github.com/google/kmsan.git master 48c6a2b0ab1b ca03d688 .config log report
ci-upstream-kmsan-gce 2018/04/18 23:42 https://github.com/google/kmsan.git master 48c6a2b0ab1b 829f0234 .config log report
ci-upstream-kmsan-gce 2018/04/18 05:10 https://github.com/google/kmsan.git master 48c6a2b0ab1b b80fd3b5 .config log report
ci-upstream-kmsan-gce 2018/04/17 16:55 https://github.com/google/kmsan.git master 48c6a2b0ab1b b80fd3b5 .config log report
ci-upstream-kmsan-gce 2018/04/09 03:51 https://github.com/google/kmsan.git master e2ab7e8abba4 77bd5117 .config log report
* Struck through repros no longer work on HEAD.