===================================================== BUG: KMSAN: uninit-value in ____bpf_skb_get_nlattr_nest net/core/filter.c:164 [inline] BUG: KMSAN: uninit-value in bpf_skb_get_nlattr_nest+0x14c/0x2f0 net/core/filter.c:154 CPU: 0 PID: 8429 Comm: syz-fuzzer 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 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215 ____bpf_skb_get_nlattr_nest net/core/filter.c:164 [inline] bpf_skb_get_nlattr_nest+0x14c/0x2f0 net/core/filter.c:154 ___bpf_prog_run+0x214d/0x97a0 kernel/bpf/core.c:1516 __bpf_prog_run32+0x101/0x170 kernel/bpf/core.c:1681 bpf_dispatcher_nop_func include/linux/bpf.h:556 [inline] bpf_prog_run_pin_on_cpu include/linux/filter.h:597 [inline] bpf_prog_run_clear_cb include/linux/filter.h:719 [inline] run_filter net/packet/af_packet.c:2012 [inline] packet_rcv+0x70f/0x2150 net/packet/af_packet.c:2085 dev_queue_xmit_nit+0x11a0/0x1280 net/core/dev.c:2355 xmit_one net/core/dev.c:3552 [inline] dev_hard_start_xmit+0x20c/0xa70 net/core/dev.c:3572 __dev_queue_xmit+0x2f8d/0x3b20 net/core/dev.c:4131 dev_queue_xmit+0x4b/0x60 net/core/dev.c:4164 hsr_xmit net/hsr/hsr_forward.c:228 [inline] hsr_forward_do net/hsr/hsr_forward.c:285 [inline] hsr_forward_skb+0x1f07/0x31f0 net/hsr/hsr_forward.c:361 send_hsr_supervision_frame+0x10a7/0x1500 net/hsr/hsr_device.c:302 hsr_announce+0x1e2/0x370 net/hsr/hsr_device.c:330 call_timer_fn+0x218/0x510 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers+0xd20/0x11c0 kernel/time/timer.c:1773 run_timer_softirq+0x2d/0x50 kernel/time/timer.c:1786 __do_softirq+0x311/0x83d kernel/softirq.c:293 asm_call_on_stack+0x12/0x20 arch/x86/entry/entry_64.S:711 __run_on_irqstack arch/x86/include/asm/irq_stack.h:23 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:50 [inline] do_softirq_own_stack+0x7c/0xa0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:390 [inline] __irq_exit_rcu+0x226/0x270 kernel/softirq.c:420 irq_exit_rcu+0xe/0x10 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x107/0x130 arch/x86/kernel/apic/apic.c:1091 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:593 RIP: 0010:kmsan_get_metadata+0x1/0x180 mm/kmsan/kmsan_shadow.c:175 Code: 0f b6 c7 48 c7 c7 b4 06 0a 91 48 c7 c6 d5 06 0a 91 4c 89 f2 31 c0 e8 b0 e4 44 ff 0f 0b 66 90 66 2e 0f 1f 84 00 00 00 00 00 55 <48> 89 e5 41 57 41 56 53 41 89 d6 48 89 fb 48 83 e3 fc 85 d2 48 0f RSP: 0018:ffff9ebb80f92cc8 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000004 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff9ebb80f92fc8 RBP: ffff9ebb80f92cf0 R08: ffffe66f4000000f R09: ffff9be56fffb000 R10: 0000000000000004 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000030 R14: ffff9ebb80f92fc8 R15: 0000000000000000 __msan_metadata_ptr_for_load_4+0x10/0x20 mm/kmsan/kmsan_instr.c:54 ror32 lib/crypto/sha256.c:43 [inline] BLEND_OP lib/crypto/sha256.c:43 [inline] sha256_transform lib/crypto/sha256.c:58 [inline] sha256_update+0x765/0x9090 lib/crypto/sha256.c:227 crypto_sha256_update+0x8b/0xb0 crypto/sha256_generic.c:51 crypto_shash_update+0x4e9/0x550 crypto/shash.c:106 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:495 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:515 [inline] ima_calc_file_hash+0x187a/0x3880 security/integrity/ima/ima_crypto.c:580 ima_collect_measurement+0x45b/0xa20 security/integrity/ima/ima_api.c:250 process_measurement+0x1a7d/0x2ce0 security/integrity/ima/ima_main.c:324 ima_file_check+0x131/0x170 security/integrity/ima/ima_main.c:492 do_open fs/namei.c:3245 [inline] path_openat+0x4b9e/0x5d50 fs/namei.c:3360 do_filp_open+0x2b8/0x710 fs/namei.c:3387 do_sys_openat2+0x96f/0xe30 fs/open.c:1179 do_sys_open fs/open.c:1195 [inline] __do_sys_openat fs/open.c:1209 [inline] __se_sys_openat+0x24a/0x2b0 fs/open.c:1204 __x64_sys_openat+0x56/0x70 fs/open.c:1204 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x4b3dfa Code: Bad RIP value. RSP: 002b:000000c00004b830 EFLAGS: 00000206 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 000000c00002c000 RCX: 00000000004b3dfa RDX: 0000000000080002 RSI: 000000c008e53800 RDI: ffffffffffffff9c RBP: 000000c00004b8a8 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000000001a4 R11: 0000000000000206 R12: 0000000000000040 R13: 0000000000000040 R14: 0000000000000200 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 __msan_chain_origin+0x50/0x90 mm/kmsan/kmsan_instr.c:165 ___bpf_prog_run+0x6cbe/0x97a0 kernel/bpf/core.c:1391 __bpf_prog_run32+0x101/0x170 kernel/bpf/core.c:1681 bpf_dispatcher_nop_func include/linux/bpf.h:556 [inline] bpf_prog_run_pin_on_cpu include/linux/filter.h:597 [inline] bpf_prog_run_clear_cb include/linux/filter.h:719 [inline] run_filter net/packet/af_packet.c:2012 [inline] packet_rcv+0x70f/0x2150 net/packet/af_packet.c:2085 dev_queue_xmit_nit+0x11a0/0x1280 net/core/dev.c:2355 xmit_one net/core/dev.c:3552 [inline] dev_hard_start_xmit+0x20c/0xa70 net/core/dev.c:3572 __dev_queue_xmit+0x2f8d/0x3b20 net/core/dev.c:4131 dev_queue_xmit+0x4b/0x60 net/core/dev.c:4164 hsr_xmit net/hsr/hsr_forward.c:228 [inline] hsr_forward_do net/hsr/hsr_forward.c:285 [inline] hsr_forward_skb+0x1f07/0x31f0 net/hsr/hsr_forward.c:361 send_hsr_supervision_frame+0x10a7/0x1500 net/hsr/hsr_device.c:302 hsr_announce+0x1e2/0x370 net/hsr/hsr_device.c:330 call_timer_fn+0x218/0x510 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers+0xd20/0x11c0 kernel/time/timer.c:1773 run_timer_softirq+0x2d/0x50 kernel/time/timer.c:1786 __do_softirq+0x311/0x83d kernel/softirq.c:293 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 __msan_chain_origin+0x50/0x90 mm/kmsan/kmsan_instr.c:165 ___bpf_prog_run+0x6c64/0x97a0 kernel/bpf/core.c:1391 __bpf_prog_run32+0x101/0x170 kernel/bpf/core.c:1681 bpf_dispatcher_nop_func include/linux/bpf.h:556 [inline] bpf_prog_run_pin_on_cpu include/linux/filter.h:597 [inline] bpf_prog_run_clear_cb include/linux/filter.h:719 [inline] run_filter net/packet/af_packet.c:2012 [inline] packet_rcv+0x70f/0x2150 net/packet/af_packet.c:2085 dev_queue_xmit_nit+0x11a0/0x1280 net/core/dev.c:2355 xmit_one net/core/dev.c:3552 [inline] dev_hard_start_xmit+0x20c/0xa70 net/core/dev.c:3572 __dev_queue_xmit+0x2f8d/0x3b20 net/core/dev.c:4131 dev_queue_xmit+0x4b/0x60 net/core/dev.c:4164 hsr_xmit net/hsr/hsr_forward.c:228 [inline] hsr_forward_do net/hsr/hsr_forward.c:285 [inline] hsr_forward_skb+0x1f07/0x31f0 net/hsr/hsr_forward.c:361 send_hsr_supervision_frame+0x10a7/0x1500 net/hsr/hsr_device.c:302 hsr_announce+0x1e2/0x370 net/hsr/hsr_device.c:330 call_timer_fn+0x218/0x510 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers+0xd20/0x11c0 kernel/time/timer.c:1773 run_timer_softirq+0x2d/0x50 kernel/time/timer.c:1786 __do_softirq+0x311/0x83d kernel/softirq.c:293 Local variable ----regs@__bpf_prog_run32 created at: __bpf_prog_run32+0x87/0x170 kernel/bpf/core.c:1681 __bpf_prog_run32+0x87/0x170 kernel/bpf/core.c:1681 =====================================================