syzbot


general protection fault in bpf_skb_cgroup_id

Status: fixed on 2022/03/08 16:11
Subsystems: bpf net
[Documentation on labels]
Reported-by: syzbot+33f36d0754d4c5c0e102@syzkaller.appspotmail.com
Fix commit: 435b08ec0094 bpf, test, cgroup: Use sk_{alloc,free} for test cases
First crash: 1147d, last: 1128d
Cause bisection: the cause commit could be any of (bisect log):
  0e6491b55970 bpf: Add oversize check before call kvcalloc()
  2f1aaf3ea666 bpf, mm: Fix lockdep warning triggered by stack_map_get_build_id_offset()
  8520e224f547 bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode
  3a029e1f3d6e selftests/bpf: Fix build of task_pt_regs test for arm64
  d8079d8026f8 bpf, selftests: Add cgroup v1 net_cls classid helpers
  43d2b88c29f2 bpf, selftests: Add test case for mixed cgroup v1/v2
  49ca6153208f bpf: Relicense disassembler as GPL-2.0-only OR BSD-2-Clause
  2865ba82476a Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
  
Discussions (5)
Title Replies (including bot) Last reply
[PATCH 5.14 000/169] 5.14.15-rc1 review 180 (180) 2022/01/11 07:33
[PATCH 5.10 00/95] 5.10.76-rc1 review 106 (106) 2021/10/26 19:16
[PATCH bpf v2 1/2] bpf, cgroup: Assign cgroup in cgroup_sk_alloc when called from interrupt 2 (2) 2021/09/27 12:39
[PATCH bpf 1/2] bpf, cgroup: Assign cgroup in cgroup_sk_alloc when called from interrupt 4 (4) 2021/09/24 21:20
[syzbot] general protection fault in bpf_skb_cgroup_id 1 (2) 2021/09/17 21:59
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 general protection fault in bpf_skb_cgroup_id C 4561 11d 1759d 0/2 upstream: reported C repro on 2020/01/11 12:22
Last patch testing requests (5)
Created Duration User Patch Repo Result
2021/09/23 10:13 10m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/bpf-cgroup-test4 OK
2021/09/21 14:48 10m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/bpf-cgroup-test3 OK
2021/09/21 06:28 16m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/bpf-cgroup-test3 OK
2021/09/20 22:20 11m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/bpf-cgroup-test2 report log
2021/09/17 22:27 16m daniel@iogearbox.net git://git.kernel.org/pub/scm/linux/kernel/git/dborkman/bpf.git pr/bpf-cgroup-test OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000029: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000148-0x000000000000014f]
CPU: 1 PID: 8436 Comm: syz-executor679 Not tainted 5.14.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:cgroup_id include/linux/cgroup.h:312 [inline]
RIP: 0010:__bpf_sk_cgroup_id net/core/filter.c:4468 [inline]
RIP: 0010:____bpf_skb_cgroup_id net/core/filter.c:4473 [inline]
RIP: 0010:bpf_skb_cgroup_id+0x138/0x210 net/core/filter.c:4471
Code: 03 80 3c 02 00 0f 85 cc 00 00 00 48 8b 9b 58 04 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb 48 01 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 ad 00 00 00 48 8b 9b 48 01 00 00 48 b8 00 00 00
RSP: 0018:ffffc9000184f9c0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000029 RSI: ffffffff8728f537 RDI: 0000000000000148
RBP: 0000000000000080 R08: 0000000000000000 R09: 0000000000000007
R10: ffffffff8728f52a R11: 000000000000001f R12: 0000000000000007
R13: ffffc90000e6a000 R14: ffffc9000184fc30 R15: ffffc90000e6a048
FS:  0000000000f5e300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200004c0 CR3: 000000001d929000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 bpf_prog_3a33f00dea259162+0x10/0xfa8
 bpf_dispatcher_nop_func include/linux/bpf.h:717 [inline]
 __bpf_prog_run include/linux/filter.h:624 [inline]
 bpf_prog_run include/linux/filter.h:631 [inline]
 bpf_test_run+0x381/0xa30 net/bpf/test_run.c:119
 bpf_prog_test_run_skb+0xac5/0x1d20 net/bpf/test_run.c:657
 bpf_prog_test_run kernel/bpf/syscall.c:3307 [inline]
 __sys_bpf+0x2137/0x5df0 kernel/bpf/syscall.c:4605
 __do_sys_bpf kernel/bpf/syscall.c:4691 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:4689 [inline]
 __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4689
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x43f009
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcff384d88 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000400488 RCX: 000000000043f009
RDX: 0000000000000028 RSI: 0000000020000440 RDI: 000000000000000a
RBP: 0000000000402ff0 R08: 0000000000000000 R09: 0000000000400488
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000403080
R13: 0000000000000000 R14: 00000000004ad018 R15: 0000000000400488
Modules linked in:
---[ end trace d161abccc2184019 ]---
RIP: 0010:cgroup_id include/linux/cgroup.h:312 [inline]
RIP: 0010:__bpf_sk_cgroup_id net/core/filter.c:4468 [inline]
RIP: 0010:____bpf_skb_cgroup_id net/core/filter.c:4473 [inline]
RIP: 0010:bpf_skb_cgroup_id+0x138/0x210 net/core/filter.c:4471
Code: 03 80 3c 02 00 0f 85 cc 00 00 00 48 8b 9b 58 04 00 00 48 b8 00 00 00 00 00 fc ff df 48 8d bb 48 01 00 00 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 ad 00 00 00 48 8b 9b 48 01 00 00 48 b8 00 00 00
RSP: 0018:ffffc9000184f9c0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000029 RSI: ffffffff8728f537 RDI: 0000000000000148
RBP: 0000000000000080 R08: 0000000000000000 R09: 0000000000000007
R10: ffffffff8728f52a R11: 000000000000001f R12: 0000000000000007
R13: ffffc90000e6a000 R14: ffffc9000184fc30 R15: ffffc90000e6a048
FS:  0000000000f5e300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200004c0 CR3: 000000001d929000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   4:	0f 85 cc 00 00 00    	jne    0xd6
   a:	48 8b 9b 58 04 00 00 	mov    0x458(%rbx),%rbx
  11:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  18:	fc ff df
  1b:	48 8d bb 48 01 00 00 	lea    0x148(%rbx),%rdi
  22:	48 89 fa             	mov    %rdi,%rdx
  25:	48 c1 ea 03          	shr    $0x3,%rdx
* 29:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2d:	0f 85 ad 00 00 00    	jne    0xe0
  33:	48 8b 9b 48 01 00 00 	mov    0x148(%rbx),%rbx
  3a:	48                   	rex.W
  3b:	b8                   	.byte 0xb8
  3c:	00 00                	add    %al,(%rax)

Crashes (107):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/09/14 16:51 bpf 2865ba82476a 07e953c1 .config console log report syz C ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/30 13:49 upstream 02d5e016800d be530f6c .config console log report info ci-upstream-kasan-gce-smack-root general protection fault in bpf_skb_cgroup_id
2021/09/30 02:58 upstream 02d5e016800d be530f6c .config console log report info ci-upstream-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/28 09:59 upstream 0513e464f900 78494d16 .config console log report info ci-upstream-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/22 22:53 upstream cf1d2c3e7e2f 8cac236e .config console log report info ci-upstream-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/17 14:44 upstream bdb575f87217 5b989942 .config console log report info ci-upstream-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/17 05:20 upstream bdb575f87217 5b989942 .config console log report info ci-upstream-kasan-gce-selinux-root general protection fault in bpf_skb_cgroup_id
2021/09/17 05:01 upstream bdb575f87217 5b989942 .config console log report info ci-upstream-kasan-gce-smack-root general protection fault in bpf_skb_cgroup_id
2021/09/17 02:48 upstream bdb575f87217 5b989942 .config console log report info ci-upstream-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/17 21:34 bpf bc23f7244817 70b76c1d .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 14:52 bpf 356ed64991c6 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 13:42 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 07:12 bpf 356ed64991c6 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 06:46 bpf 356ed64991c6 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 06:03 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 05:59 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 05:47 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 04:52 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 04:50 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 04:45 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 04:37 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/15 04:26 net-old 7366c23ff492 07e953c1 .config console log report info ci-upstream-net-this-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 16:20 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 16:15 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 16:08 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 16:07 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 16:04 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 15:46 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 15:37 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 15:29 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 15:24 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 15:17 bpf 2865ba82476a 07e953c1 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 14:51 bpf 2865ba82476a 58d09404 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 14:43 bpf 2865ba82476a 58d09404 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 14:34 bpf 2865ba82476a 58d09404 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/14 13:56 bpf 2865ba82476a 58d09404 .config console log report info ci-upstream-bpf-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/10/03 03:40 bpf-next d636c8da2d60 db0f5787 .config console log report info ci-upstream-bpf-next-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/10/01 18:28 bpf-next 6bbc7103738f cc80db95 .config console log report info ci-upstream-bpf-next-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/30 03:11 bpf-next 3103836496e7 be530f6c .config console log report info ci-upstream-bpf-next-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/18 09:58 bpf-next e57f52b42d1f 70b76c1d .config console log report info ci-upstream-bpf-next-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/18 09:49 bpf-next e57f52b42d1f 70b76c1d .config console log report info ci-upstream-bpf-next-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/17 18:39 net-next-old 5ef8a0291513 70b76c1d .config console log report info ci-upstream-net-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/17 03:55 net-next-old 561bed688bff 5b989942 .config console log report info ci-upstream-net-kasan-gce general protection fault in bpf_skb_cgroup_id
2021/09/28 11:32 linux-next bf5b1e621a51 78494d16 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/18 04:52 linux-next 9004fd387338 70b76c1d .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 14:55 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 13:38 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 10:48 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 10:48 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 10:39 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 07:53 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 07:48 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 06:52 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
2021/09/15 05:49 linux-next 70ced02f322f 07e953c1 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in bpf_skb_cgroup_id
* Struck through repros no longer work on HEAD.