BUG: kernel NULL pointer dereference, address: 0000000000000038 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 8000000112eb9067 P4D 8000000112eb9067 PUD 1129c1067 PMD 0 Oops: Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 3317 Comm: syz.0.15 Not tainted 6.10.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 RIP: 0010:bpf_net_ctx_get_ri include/linux/filter.h:782 [inline] RIP: 0010:__bpf_xdp_redirect_map include/linux/filter.h:1631 [inline] RIP: 0010:dev_hash_map_redirect+0x17/0x100 kernel/bpf/devmap.c:1028 Code: cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 89 d0 65 48 8b 0c 25 80 fe 02 00 48 8b 89 90 16 00 00 <8b> 51 38 f6 c2 02 75 2c c7 41 20 00 00 00 00 48 c7 41 18 00 00 00 RSP: 0018:ffffc900012cfc30 EFLAGS: 00010246 RAX: 0000000000000008 RBX: ffffc90000e610b8 RCX: 0000000000000000 RDX: 0000000000000008 RSI: 00000000012cfce0 RDI: ffff888111d00c00 RBP: ffffc900012cfcf8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: ffffffff81334220 R12: ffffc900012cfc60 R13: 000000000000004e R14: 0000000000000140 R15: 0000000000000000 FS: 00007f4f9f9416c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000038 CR3: 0000000112bbe000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ___bpf_prog_run+0x5f6/0x2280 kernel/bpf/core.c:2012 __bpf_prog_run32+0xbb/0xe0 kernel/bpf/core.c:2253 bpf_dispatcher_nop_func include/linux/bpf.h:1243 [inline] __bpf_prog_run include/linux/filter.h:691 [inline] bpf_prog_run_xdp include/net/xdp.h:514 [inline] tun_build_skb drivers/net/tun.c:1711 [inline] tun_get_user+0x4a8/0x12c0 drivers/net/tun.c:1819 tun_chr_write_iter+0x5a/0xc0 drivers/net/tun.c:2048 new_sync_write fs/read_write.c:497 [inline] vfs_write+0x2fc/0x490 fs/read_write.c:590 ksys_write+0x70/0xe0 fs/read_write.c:643 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x8d/0x1a0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4f9feb675f Code: 89 54 24 18 48 89 74 24 10 89 7c 24 08 e8 29 8c 02 00 48 8b 54 24 18 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 31 44 89 c7 48 89 44 24 08 e8 7c 8c 02 00 48 RSP: 002b:00007f4f9f941010 EFLAGS: 00000293 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4fa0045f60 RCX: 00007f4f9feb675f RDX: 000000000000004e RSI: 0000000020000540 RDI: 00000000000000c8 RBP: 00007f4f9ff26aa1 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000004e R11: 0000000000000293 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4fa0045f60 R15: 00007ffc898b9f68 Modules linked in: CR2: 0000000000000038 ---[ end trace 0000000000000000 ]--- RIP: 0010:bpf_net_ctx_get_ri include/linux/filter.h:782 [inline] RIP: 0010:__bpf_xdp_redirect_map include/linux/filter.h:1631 [inline] RIP: 0010:dev_hash_map_redirect+0x17/0x100 kernel/bpf/devmap.c:1028 Code: cc cc 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 89 d0 65 48 8b 0c 25 80 fe 02 00 48 8b 89 90 16 00 00 <8b> 51 38 f6 c2 02 75 2c c7 41 20 00 00 00 00 48 c7 41 18 00 00 00 RSP: 0018:ffffc900012cfc30 EFLAGS: 00010246 RAX: 0000000000000008 RBX: ffffc90000e610b8 RCX: 0000000000000000 RDX: 0000000000000008 RSI: 00000000012cfce0 RDI: ffff888111d00c00 RBP: ffffc900012cfcf8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: ffffffff81334220 R12: ffffc900012cfc60 R13: 000000000000004e R14: 0000000000000140 R15: 0000000000000000 FS: 00007f4f9f9416c0(0000) GS:ffff888237d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000038 CR3: 0000000112bbe000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: cc int3 1: cc int3 2: 90 nop 3: 90 nop 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: 90 nop 11: 90 nop 12: 90 nop 13: f3 0f 1e fa endbr64 17: 48 89 d0 mov %rdx,%rax 1a: 65 48 8b 0c 25 80 fe mov %gs:0x2fe80,%rcx 21: 02 00 23: 48 8b 89 90 16 00 00 mov 0x1690(%rcx),%rcx * 2a: 8b 51 38 mov 0x38(%rcx),%edx <-- trapping instruction 2d: f6 c2 02 test $0x2,%dl 30: 75 2c jne 0x5e 32: c7 41 20 00 00 00 00 movl $0x0,0x20(%rcx) 39: 48 rex.W 3a: c7 .byte 0xc7 3b: 41 18 00 sbb %al,(%r8)