syzbot


KMSAN: uninit-value in iptable_mangle_hook

Status: fixed on 2018/05/08 18:30
Subsystems: netfilter
[Documentation on labels]
Fix commit: b855ff827476 dccp: initialize ireq->ir_mark
First crash: 2381d, last: 2349d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in iptable_mangle_hook (5) netfilter 51 1185d 1306d 0/28 auto-closed as invalid on 2021/11/12 20:56
upstream KMSAN: uninit-value in iptable_mangle_hook (3) netfilter 5 2152d 2270d 0/28 auto-closed as invalid on 2019/05/20 19:01
upstream KMSAN: uninit-value in iptable_mangle_hook (4) netfilter syz 128 1316d 1771d 0/28 closed as invalid on 2021/03/12 07:36
upstream KMSAN: kernel-infoleak in _copy_to_iter (7) net C 138977 597d 949d 22/28 fixed on 2023/02/24 13:50

Sample crash report:
==================================================================
BUG: KMSAN: uninit-value in ipt_mangle_out net/ipv4/netfilter/iptable_mangle.c:66 [inline]
BUG: KMSAN: uninit-value in iptable_mangle_hook+0x5e5/0x720 net/ipv4/netfilter/iptable_mangle.c:84
CPU: 1 PID: 14 Comm: ksoftirqd/1 Not tainted 4.16.0+ #87
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:683
 ipt_mangle_out net/ipv4/netfilter/iptable_mangle.c:66 [inline]
 iptable_mangle_hook+0x5e5/0x720 net/ipv4/netfilter/iptable_mangle.c:84
 nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline]
 nf_hook_slow+0x158/0x3d0 net/netfilter/core.c:483
 nf_hook include/linux/netfilter.h:243 [inline]
 __ip_local_out+0x6d5/0x7e0 net/ipv4/ip_output.c:113
 ip_local_out net/ipv4/ip_output.c:122 [inline]
 ip_queue_xmit+0x1958/0x1d10 net/ipv4/ip_output.c:504
 dccp_transmit_skb+0x15eb/0x1900 net/dccp/output.c:142
 dccp_send_reset+0x398/0x4e0 net/dccp/output.c:530
 dccp_rcv_close+0x136/0x350 net/dccp/input.c:74
 dccp_rcv_state_process+0x850/0x2410 net/dccp/input.c:671
 dccp_v4_do_rcv+0x229/0x340 net/dccp/ipv4.c:682
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __sk_receive_skb+0x60e/0xf20 net/core/sock.c:513
 dccp_v4_rcv+0x25e5/0x2750 net/dccp/ipv4.c:874
 ip_local_deliver_finish+0x874/0xec0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_local_deliver+0x43c/0x4e0 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:449 [inline]
 ip_rcv_finish+0xa36/0x1d00 net/ipv4/ip_input.c:397
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x118f/0x16d0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 process_backlog+0x62d/0xe20 net/core/dev.c:5307
 napi_poll net/core/dev.c:5705 [inline]
 net_rx_action+0x7c1/0x1a70 net/core/dev.c:5771
 __do_softirq+0x56d/0x93d kernel/softirq.c:285
 run_ksoftirqd+0x1f/0x40 kernel/softirq.c:666
 smpboot_thread_fn+0x488/0x970 kernel/smpboot.c:164
 kthread+0x539/0x720 kernel/kthread.c:239
 ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:406

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:293 [inline]
 kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:684
 __msan_chain_origin+0x69/0xc0 mm/kmsan/kmsan_instr.c:528
 ip_queue_xmit+0x1b47/0x1d10 net/ipv4/ip_output.c:502
 dccp_transmit_skb+0x15eb/0x1900 net/dccp/output.c:142
 dccp_send_reset+0x398/0x4e0 net/dccp/output.c:530
 dccp_rcv_close+0x136/0x350 net/dccp/input.c:74
 dccp_rcv_state_process+0x850/0x2410 net/dccp/input.c:671
 dccp_v4_do_rcv+0x229/0x340 net/dccp/ipv4.c:682
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __sk_receive_skb+0x60e/0xf20 net/core/sock.c:513
 dccp_v4_rcv+0x25e5/0x2750 net/dccp/ipv4.c:874
 ip_local_deliver_finish+0x874/0xec0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_local_deliver+0x43c/0x4e0 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:449 [inline]
 ip_rcv_finish+0xa36/0x1d00 net/ipv4/ip_input.c:397
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x118f/0x16d0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 process_backlog+0x62d/0xe20 net/core/dev.c:5307
 napi_poll net/core/dev.c:5705 [inline]
 net_rx_action+0x7c1/0x1a70 net/core/dev.c:5771
 __do_softirq+0x56d/0x93d kernel/softirq.c:285
Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline]
 kmsan_save_stack mm/kmsan/kmsan.c:293 [inline]
 kmsan_internal_chain_origin+0x12b/0x210 mm/kmsan/kmsan.c:684
 __msan_chain_origin+0x69/0xc0 mm/kmsan/kmsan_instr.c:528
 inet_csk_clone_lock+0x503/0x580 net/ipv4/inet_connection_sock.c:797
 dccp_create_openreq_child+0x7f/0x890 net/dccp/minisocks.c:92
 dccp_v4_request_recv_sock+0x22c/0xe90 net/dccp/ipv4.c:408
 dccp_v6_request_recv_sock+0x2a3/0x2090 net/dccp/ipv6.c:414
 dccp_check_req+0x7b9/0x8f0 net/dccp/minisocks.c:197
 dccp_v4_rcv+0x12c1/0x2750 net/dccp/ipv4.c:840
 ip_local_deliver_finish+0x874/0xec0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_local_deliver+0x43c/0x4e0 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:449 [inline]
 ip_rcv_finish+0xa36/0x1d00 net/ipv4/ip_input.c:397
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x118f/0x16d0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 process_backlog+0x62d/0xe20 net/core/dev.c:5307
 napi_poll net/core/dev.c:5705 [inline]
 net_rx_action+0x7c1/0x1a70 net/core/dev.c:5771
 __do_softirq+0x56d/0x93d kernel/softirq.c:285
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
 reqsk_alloc include/net/request_sock.h:88 [inline]
 inet_reqsk_alloc+0xc4/0x7f0 net/ipv4/tcp_input.c:6145
 dccp_v4_conn_request+0x5cc/0x1770 net/dccp/ipv4.c:600
 dccp_v6_conn_request+0x299/0x18f0 net/dccp/ipv6.c:317
 dccp_rcv_state_process+0x2ea/0x2410 net/dccp/input.c:612
 dccp_v4_do_rcv+0x229/0x340 net/dccp/ipv4.c:682
 dccp_v6_do_rcv+0x16d/0x1290 net/dccp/ipv6.c:578
 sk_backlog_rcv include/net/sock.h:908 [inline]
 __sk_receive_skb+0x60e/0xf20 net/core/sock.c:513
 dccp_v4_rcv+0x25e5/0x2750 net/dccp/ipv4.c:874
 ip_local_deliver_finish+0x874/0xec0 net/ipv4/ip_input.c:216
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_local_deliver+0x43c/0x4e0 net/ipv4/ip_input.c:257
 dst_input include/net/dst.h:449 [inline]
 ip_rcv_finish+0xa36/0x1d00 net/ipv4/ip_input.c:397
 NF_HOOK include/linux/netfilter.h:288 [inline]
 ip_rcv+0x118f/0x16d0 net/ipv4/ip_input.c:493
 __netif_receive_skb_core+0x47df/0x4a90 net/core/dev.c:4562
 __netif_receive_skb net/core/dev.c:4627 [inline]
 process_backlog+0x62d/0xe20 net/core/dev.c:5307
 napi_poll net/core/dev.c:5705 [inline]
 net_rx_action+0x7c1/0x1a70 net/core/dev.c:5771
 __do_softirq+0x56d/0x93d kernel/softirq.c:285
==================================================================

Crashes (1134):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/26 15:04 https://github.com/google/kmsan.git master d2d741e5d189 73417389 .config console log report syz C ci-upstream-kmsan-gce
2018/04/20 12:01 https://github.com/google/kmsan.git master 48c6a2b0ab1b eae05cb0 .config console log report syz C ci-upstream-kmsan-gce
2018/04/20 04:49 https://github.com/google/kmsan.git master 48c6a2b0ab1b eae05cb0 .config console log report syz C ci-upstream-kmsan-gce
2018/04/07 16:32 https://github.com/google/kmsan.git master e2ab7e8abba4 66f22a7f .config console log report syz C ci-upstream-kmsan-gce
2018/05/08 18:04 https://github.com/google/kmsan.git master d2d741e5d189 b88872ba .config console log report ci-upstream-kmsan-gce
2018/05/08 15:44 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config console log report ci-upstream-kmsan-gce
2018/05/08 12:46 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config console log report ci-upstream-kmsan-gce
2018/05/08 09:07 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config console log report ci-upstream-kmsan-gce
2018/05/08 05:35 https://github.com/google/kmsan.git master d2d741e5d189 045bbd4a .config console log report ci-upstream-kmsan-gce
2018/05/08 04:00 https://github.com/google/kmsan.git master d2d741e5d189 9e0846e8 .config console log report ci-upstream-kmsan-gce
2018/05/08 00:46 https://github.com/google/kmsan.git master d2d741e5d189 9e0846e8 .config console log report ci-upstream-kmsan-gce
2018/05/07 19:04 https://github.com/google/kmsan.git master d2d741e5d189 9e0846e8 .config console log report ci-upstream-kmsan-gce
2018/05/07 17:26 https://github.com/google/kmsan.git master d2d741e5d189 9e0846e8 .config console log report ci-upstream-kmsan-gce
2018/05/07 13:32 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/07 10:24 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/07 08:10 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/07 05:52 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/07 02:59 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/07 00:51 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/06 23:29 https://github.com/google/kmsan.git master d2d741e5d189 a211da1a .config console log report ci-upstream-kmsan-gce
2018/05/06 19:58 https://github.com/google/kmsan.git master d2d741e5d189 6c18ddb0 .config console log report ci-upstream-kmsan-gce
2018/05/06 17:56 https://github.com/google/kmsan.git master d2d741e5d189 6c18ddb0 .config console log report ci-upstream-kmsan-gce
2018/05/06 15:49 https://github.com/google/kmsan.git master d2d741e5d189 6c18ddb0 .config console log report ci-upstream-kmsan-gce
2018/05/06 11:20 https://github.com/google/kmsan.git master d2d741e5d189 6c18ddb0 .config console log report ci-upstream-kmsan-gce
2018/05/06 07:21 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config console log report ci-upstream-kmsan-gce
2018/05/06 05:50 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config console log report ci-upstream-kmsan-gce
2018/05/06 04:33 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config console log report ci-upstream-kmsan-gce
2018/05/06 03:09 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config console log report ci-upstream-kmsan-gce
2018/05/05 23:42 https://github.com/google/kmsan.git master d2d741e5d189 78b251cb .config console log report ci-upstream-kmsan-gce
2018/05/05 16:41 https://github.com/google/kmsan.git master d2d741e5d189 6a0382b5 .config console log report ci-upstream-kmsan-gce
2018/05/05 11:17 https://github.com/google/kmsan.git master d2d741e5d189 6a0382b5 .config console log report ci-upstream-kmsan-gce
2018/05/05 09:43 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/05 06:28 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/05 02:04 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/05 00:58 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 20:55 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 18:18 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 16:08 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 14:46 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 09:45 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 06:57 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 04:43 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 03:41 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/04 02:01 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/05/03 21:17 https://github.com/google/kmsan.git master d2d741e5d189 9ce14f4b .config console log report ci-upstream-kmsan-gce
2018/04/06 23:10 https://github.com/google/kmsan.git master e2ab7e8abba4 d613535f .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.