syzbot


general protection fault in bpf_map_offload_map_alloc

Status: upstream: reported on 2025/03/07 07:39
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+0c7bfd8cf3aecec92708@syzkaller.appspotmail.com
Fix commit: bpf: fix a possible NULL deref in bpf_map_offload_map_alloc()
Patched on: [ci-upstream-net-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 18d, last: 17d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH net-next] bpf: fix a possible NULL deref in bpf_map_offload_map_alloc() 3 (3) 2025/03/08 03:40
[syzbot] [bpf?] general protection fault in bpf_map_offload_map_alloc 0 (1) 2025/03/07 07:39

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000197: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000cb8-0x0000000000000cbf]
CPU: 1 UID: 0 PID: 7310 Comm: syz.2.380 Not tainted 6.14.0-rc5-syzkaller-01096-g865eddcf0afb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:netdev_need_ops_lock include/linux/netdevice.h:2792 [inline]
RIP: 0010:netdev_lock_ops include/linux/netdevice.h:2803 [inline]
RIP: 0010:bpf_map_offload_map_alloc+0x19a/0x910 kernel/bpf/offload.c:533
Code: 48 89 44 24 30 42 80 3c 20 00 74 08 48 89 df e8 ac e6 3b 00 48 89 5c 24 18 4c 89 2b 49 8d 9d bd 0c 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 df 06 00 00 0f b6 1b 31 ff 89 de e8 dd
RSP: 0018:ffffc90003b7fbc0 EFLAGS: 00010203
RAX: 0000000000000197 RBX: 0000000000000cbd RCX: 0000000000080000
RDX: ffffc9000c269000 RSI: 000000000000008f RDI: 0000000000000090
RBP: ffffc90003b7fcd8 R08: ffffffff903d0b77 R09: 1ffffffff207a16e
R10: dffffc0000000000 R11: fffffbfff207a16f R12: dffffc0000000000
R13: 0000000000000000 R14: ffff888035bb3c80 R15: 1ffff9200076ff80
FS:  00007f029f11e6c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffdfa50000 CR3: 000000003379c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 map_create+0x946/0x11c0 kernel/bpf/syscall.c:1455
 __sys_bpf+0x6d3/0x820 kernel/bpf/syscall.c:5777
 __do_sys_bpf kernel/bpf/syscall.c:5902 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5900 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:5900
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f029e38d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f029f11e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f029e5a5fa0 RCX: 00007f029e38d169
RDX: 0000000000000050 RSI: 00004000000000c0 RDI: 0000000000000000
RBP: 00007f029e40e2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f029e5a5fa0 R15: 00007fffb9df7f88
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:netdev_need_ops_lock include/linux/netdevice.h:2792 [inline]
RIP: 0010:netdev_lock_ops include/linux/netdevice.h:2803 [inline]
RIP: 0010:bpf_map_offload_map_alloc+0x19a/0x910 kernel/bpf/offload.c:533
Code: 48 89 44 24 30 42 80 3c 20 00 74 08 48 89 df e8 ac e6 3b 00 48 89 5c 24 18 4c 89 2b 49 8d 9d bd 0c 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 0f 85 df 06 00 00 0f b6 1b 31 ff 89 de e8 dd
RSP: 0018:ffffc90003b7fbc0 EFLAGS: 00010203
RAX: 0000000000000197 RBX: 0000000000000cbd RCX: 0000000000080000
RDX: ffffc9000c269000 RSI: 000000000000008f RDI: 0000000000000090
RBP: ffffc90003b7fcd8 R08: ffffffff903d0b77 R09: 1ffffffff207a16e
R10: dffffc0000000000 R11: fffffbfff207a16f R12: dffffc0000000000
R13: 0000000000000000 R14: ffff888035bb3c80 R15: 1ffff9200076ff80
FS:  00007f029f11e6c0(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffdfa50000 CR3: 000000003379c000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 89 44 24 30       	mov    %rax,0x30(%rsp)
   5:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1)
   a:	74 08                	je     0x14
   c:	48 89 df             	mov    %rbx,%rdi
   f:	e8 ac e6 3b 00       	call   0x3be6c0
  14:	48 89 5c 24 18       	mov    %rbx,0x18(%rsp)
  19:	4c 89 2b             	mov    %r13,(%rbx)
  1c:	49 8d 9d bd 0c 00 00 	lea    0xcbd(%r13),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 20       	movzbl (%rax,%r12,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 df 06 00 00    	jne    0x716
  37:	0f b6 1b             	movzbl (%rbx),%ebx
  3a:	31 ff                	xor    %edi,%edi
  3c:	89 de                	mov    %ebx,%esi
  3e:	e8                   	.byte 0xe8
  3f:	dd                   	.byte 0xdd

Crashes (494):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/08 04:00 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/08 03:23 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/08 02:52 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/08 01:54 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/08 01:13 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/08 00:28 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 23:33 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 22:50 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 22:16 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 21:34 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 21:04 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 20:29 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 19:48 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 19:01 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 18:11 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 17:40 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 16:53 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 15:54 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 15:18 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 15:14 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 14:11 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 13:40 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 12:38 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 12:33 net-next 865eddcf0afb 7e3bd60d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 10:15 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 09:13 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 08:37 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 07:29 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 06:29 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 06:28 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 06:17 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 06:06 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 05:48 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 05:46 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 05:36 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:26 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:24 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:19 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:18 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:17 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 04:16 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 03:15 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/07 03:00 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
2025/03/06 23:33 net-next 2525e16a2bae 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce general protection fault in bpf_map_offload_map_alloc
* Struck through repros no longer work on HEAD.