================================================================== BUG: KMSAN: uninit-value in bpf_convert_filter+0x2a33/0x5c50 net/core/filter.c:603 CPU: 1 PID: 13136 Comm: syz-executor.2 Not tainted 5.0.0-rc1+ #9 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:600 __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:313 bpf_convert_filter+0x2a33/0x5c50 net/core/filter.c:603 bpf_migrate_filter net/core/filter.c:1245 [inline] bpf_prepare_filter+0x15e4/0x1c90 net/core/filter.c:1323 __get_filter+0x4f8/0x730 net/core/filter.c:1492 sk_attach_filter+0x72/0x2e0 net/core/filter.c:1507 sock_setsockopt+0x396f/0x4bb0 net/core/sock.c:895 __sys_setsockopt+0x336/0x540 net/socket.c:1898 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt+0xdd/0x100 net/socket.c:1910 __x64_sys_setsockopt+0x62/0x80 net/socket.c:1910 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x457e29 Code: ad b8 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 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8dfef16c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000457e29 RDX: 000000000000001a RSI: 0000000000000001 RDI: 0000000000000006 RBP: 000000000073bfa0 R08: 0000000000000010 R09: 0000000000000000 R10: 000000002002eff0 R11: 0000000000000246 R12: 00007f8dfef176d4 R13: 00000000004c584f R14: 00000000004d9a88 R15: 00000000ffffffff Uninit was stored to memory at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:205 [inline] kmsan_save_stack mm/kmsan/kmsan.c:220 [inline] kmsan_internal_chain_origin+0x134/0x230 mm/kmsan/kmsan.c:426 kmsan_memcpy_memmove_metadata+0xcf2/0xf10 mm/kmsan/kmsan.c:304 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:324 __msan_memcpy+0x58/0x70 mm/kmsan/kmsan_instr.c:139 kmemdup+0xb4/0xf0 mm/util.c:113 bpf_migrate_filter net/core/filter.c:1237 [inline] bpf_prepare_filter+0x154b/0x1c90 net/core/filter.c:1323 __get_filter+0x4f8/0x730 net/core/filter.c:1492 sk_attach_filter+0x72/0x2e0 net/core/filter.c:1507 sock_setsockopt+0x396f/0x4bb0 net/core/sock.c:895 __sys_setsockopt+0x336/0x540 net/socket.c:1898 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt+0xdd/0x100 net/socket.c:1910 __x64_sys_setsockopt+0x62/0x80 net/socket.c:1910 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Uninit was created at: kmsan_save_stack_with_flags+0x7a/0x130 mm/kmsan/kmsan.c:205 kmsan_internal_alloc_meta_for_pages+0x113/0x580 mm/kmsan/kmsan_hooks.c:98 kmsan_alloc_page+0x7e/0x100 mm/kmsan/kmsan_hooks.c:396 __alloc_pages_nodemask+0x137b/0x5e30 mm/page_alloc.c:4572 alloc_pages_current+0x69d/0x9b0 mm/mempolicy.c:2106 alloc_pages include/linux/gfp.h:511 [inline] __get_free_pages+0x33/0xc0 mm/page_alloc.c:4589 tlb_next_batch mm/mmu_gather.c:30 [inline] __tlb_remove_page_size+0x341/0x560 mm/mmu_gather.c:143 __tlb_remove_page include/asm-generic/tlb.h:187 [inline] zap_pte_range mm/memory.c:1094 [inline] zap_pmd_range mm/memory.c:1193 [inline] zap_pud_range mm/memory.c:1222 [inline] zap_p4d_range mm/memory.c:1243 [inline] unmap_page_range+0x2098/0x3f20 mm/memory.c:1264 unmap_single_vma+0x43f/0x5e0 mm/memory.c:1309 unmap_vmas+0x321/0x440 mm/memory.c:1340 exit_mmap+0x50e/0xa00 mm/mmap.c:3140 __mmput+0x159/0x5f0 kernel/fork.c:1048 mmput+0xb9/0x110 kernel/fork.c:1069 exit_mm+0x706/0x7b0 kernel/exit.c:546 do_exit+0xbb8/0x3860 kernel/exit.c:856 do_group_exit+0x185/0x320 kernel/exit.c:972 get_signal+0x6d5/0x2050 kernel/signal.c:2517 do_signal+0x1d5/0x2cc0 arch/x86/kernel/signal.c:816 exit_to_usermode_loop arch/x86/entry/common.c:162 [inline] prepare_exit_to_usermode+0x245/0x420 arch/x86/entry/common.c:197 syscall_return_slowpath+0xb2/0x650 arch/x86/entry/common.c:268 do_syscall_64+0xe2/0xf0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x63/0xe7 ==================================================================