syzbot


KMSAN: uninit-value in _copy_to_iter (3)

Status: upstream: reported C repro on 2020/07/22 06:03
Reported-by: syzbot+81908a97abeec4f4f02d@syzkaller.appspotmail.com
First crash: 811d, last: 806d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in _copy_to_iter C 32 1628d 1643d 0/24 closed as invalid on 2018/04/22 15:44
upstream KMSAN: uninit-value in _copy_to_iter (2) C 226 1581d 1627d 9/24 fixed on 2018/07/09 18:05
Patch testing requests:
Created Duration User Patch Repo Result
2022/09/10 04:27 21m https://github.com/google/kmsan.git master OK log
2022/09/10 01:27 19m https://github.com/google/kmsan.git master OK log
2022/08/31 03:27 7m https://github.com/google/kmsan.git master error
2020/09/25 18:12 18m anant.thazhemadam@gmail.com patch https://github.com/google/kmsan.git master OK
2020/09/20 16:41 12m anant.thazhemadam@gmail.com https://github.com/google/kmsan.git master report log
2020/08/27 06:51 12m foxhlchen@gmail.com https://github.com/google/kmsan.git master report log

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in kmsan_check_memory+0xd/0x10 mm/kmsan/kmsan_hooks.c:428
CPU: 1 PID: 8727 Comm: syz-executor164 Not tainted 5.8.0-rc5-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+0x1df/0x240 lib/dump_stack.c:118
 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121
 kmsan_internal_check_memory+0x238/0x3d0 mm/kmsan/kmsan.c:423
 kmsan_check_memory+0xd/0x10 mm/kmsan/kmsan_hooks.c:428
 instrument_copy_to_user include/linux/instrumented.h:91 [inline]
 copyout lib/iov_iter.c:142 [inline]
 _copy_to_iter+0x3d4/0x26e0 lib/iov_iter.c:631
 copy_to_iter include/linux/uio.h:138 [inline]
 simple_copy_to_iter net/core/datagram.c:519 [inline]
 __skb_datagram_iter+0x2bb/0x1220 net/core/datagram.c:425
 skb_copy_datagram_iter+0x292/0x2b0 net/core/datagram.c:533
 skb_copy_datagram_msg include/linux/skbuff.h:3511 [inline]
 packet_recvmsg+0x630/0x1c40 net/packet/af_packet.c:3378
 sock_recvmsg_nosec net/socket.c:886 [inline]
 sock_recvmsg net/socket.c:904 [inline]
 sock_read_iter+0x750/0x760 net/socket.c:977
 call_read_iter include/linux/fs.h:1902 [inline]
 new_sync_read fs/read_write.c:415 [inline]
 vfs_read+0xc67/0x1230 fs/read_write.c:481
 ksys_read+0x267/0x450 fs/read_write.c:607
 __do_sys_read fs/read_write.c:617 [inline]
 __se_sys_read+0x92/0xb0 fs/read_write.c:615
 __ia32_sys_read+0x4a/0x70 fs/read_write.c:615
 do_syscall_32_irqs_on arch/x86/entry/common.c:430 [inline]
 __do_fast_syscall_32+0x2aa/0x400 arch/x86/entry/common.c:477
 do_fast_syscall_32+0x6b/0xd0 arch/x86/entry/common.c:505
 do_SYSENTER_32+0x73/0x90 arch/x86/entry/common.c:554
 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c
RIP: 0023:0xf7ffa549
Code: Bad RIP value.
RSP: 002b:00000000ffae3cec EFLAGS: 00000246 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000020000000
RDX: 000000000000003c RSI: 00000000f7ffa28c RDI: 0000000000000004
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:310
 kmsan_memcpy_memmove_metadata+0x272/0x2e0 mm/kmsan/kmsan.c:247
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:267
 __msan_memcpy+0x43/0x50 mm/kmsan/kmsan_instr.c:116
 pskb_expand_head+0x38b/0x1b00 net/core/skbuff.c:1636
 __skb_cow include/linux/skbuff.h:3145 [inline]
 skb_cow_head include/linux/skbuff.h:3179 [inline]
 batadv_skb_head_push+0x234/0x350 net/batman-adv/soft-interface.c:75
 batadv_send_skb_packet+0x1a7/0x8c0 net/batman-adv/send.c:86
 batadv_send_broadcast_skb+0x76/0x90 net/batman-adv/send.c:127
 batadv_iv_ogm_send_to_if net/batman-adv/bat_iv_ogm.c:393 [inline]
 batadv_iv_ogm_emit net/batman-adv/bat_iv_ogm.c:419 [inline]
 batadv_iv_send_outstanding_bat_ogm_packet+0x97e/0xd50 net/batman-adv/bat_iv_ogm.c:1710
 process_one_work+0x1540/0x1f30 kernel/workqueue.c:2269
 worker_thread+0xed2/0x23f0 kernel/workqueue.c:2415
 kthread+0x515/0x550 kernel/kthread.c:292
 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:293

Uninit was created at:
 kmsan_save_stack_with_flags+0x3c/0x90 mm/kmsan/kmsan.c:144
 kmsan_internal_alloc_meta_for_pages mm/kmsan/kmsan_shadow.c:269 [inline]
 kmsan_alloc_page+0xb9/0x180 mm/kmsan/kmsan_shadow.c:293
 __alloc_pages_nodemask+0x56a2/0x5dc0 mm/page_alloc.c:4889
 __alloc_pages include/linux/gfp.h:509 [inline]
 __alloc_pages_node include/linux/gfp.h:522 [inline]
 alloc_pages_node include/linux/gfp.h:536 [inline]
 __page_frag_cache_refill mm/page_alloc.c:4964 [inline]
 page_frag_alloc+0x3ae/0x910 mm/page_alloc.c:4994
 __napi_alloc_skb+0x193/0xa60 net/core/skbuff.c:519
 napi_alloc_skb include/linux/skbuff.h:2850 [inline]
 page_to_skb+0x1a2/0x1390 drivers/net/virtio_net.c:384
 receive_mergeable drivers/net/virtio_net.c:944 [inline]
 receive_buf+0xf9e/0x9760 drivers/net/virtio_net.c:1054
 virtnet_receive drivers/net/virtio_net.c:1346 [inline]
 virtnet_poll+0x64b/0x19f0 drivers/net/virtio_net.c:1451
 napi_poll net/core/dev.c:6684 [inline]
 net_rx_action+0x746/0x1aa0 net/core/dev.c:6752
 __do_softirq+0x311/0x83d kernel/softirq.c:293

Bytes 52-53 of 60 are uninitialized
Memory access of size 60 starts at ffff9f09f4c35c40
=====================================================

Crashes (155):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kmsan-gce-386 2020/07/20 08:23 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report syz C
ci-upstream-kmsan-gce 2020/07/19 14:33 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report syz C
ci-upstream-kmsan-gce 2020/07/19 13:03 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report syz C
ci-upstream-kmsan-gce 2020/07/22 14:20 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce 2020/07/22 11:00 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce 2020/07/22 08:51 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce 2020/07/22 06:12 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce 2020/07/22 04:56 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce 2020/07/22 04:10 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce 2020/07/21 18:11 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce 2020/07/21 15:02 https://github.com/google/kmsan.git master 91e18444d6b0 d88894e6 .config log report
ci-upstream-kmsan-gce 2020/07/21 14:40 https://github.com/google/kmsan.git master 91e18444d6b0 d88894e6 .config log report
ci-upstream-kmsan-gce 2020/07/21 12:02 https://github.com/google/kmsan.git master 91e18444d6b0 d88894e6 .config log report
ci-upstream-kmsan-gce 2020/07/21 09:08 https://github.com/google/kmsan.git master 91e18444d6b0 d88894e6 .config log report
ci-upstream-kmsan-gce 2020/07/21 05:59 https://github.com/google/kmsan.git master 91e18444d6b0 d88894e6 .config log report
ci-upstream-kmsan-gce 2020/07/21 00:33 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce 2020/07/20 21:51 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce 2020/07/20 20:34 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce 2020/07/20 15:55 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce 2020/07/20 07:16 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/20 01:49 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/19 21:55 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/19 16:48 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/19 15:37 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/19 07:50 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/19 02:56 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 20:48 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 20:24 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 20:20 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 20:03 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 20:02 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 19:22 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/18 05:28 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce 2020/07/17 23:13 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/22 15:33 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce-386 2020/07/22 12:00 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce-386 2020/07/22 09:59 https://github.com/google/kmsan.git master 91e18444d6b0 128cd85f .config log report
ci-upstream-kmsan-gce-386 2020/07/21 22:44 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce-386 2020/07/21 21:16 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce-386 2020/07/21 19:55 https://github.com/google/kmsan.git master 91e18444d6b0 21f1765e .config log report
ci-upstream-kmsan-gce-386 2020/07/21 03:06 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce-386 2020/07/20 18:31 https://github.com/google/kmsan.git master 91e18444d6b0 4285ffa3 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 12:36 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 11:32 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 10:17 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 06:33 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 04:17 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/19 01:24 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/18 20:35 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
ci-upstream-kmsan-gce-386 2020/07/18 19:15 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config log report
* Struck through repros no longer work on HEAD.