syzbot


general protection fault in get_memcg

Status: moderation: reported on 2024/05/20 12:17
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+57fd9e3f4bc5f2e64deb@syzkaller.appspotmail.com
First crash: 29d, last: 29d

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xe01ffbf110036b12: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range [0x00ffff88801b5890-0x00ffff88801b5897]
CPU: 3 PID: 11805 Comm: syz-executor.1 Not tainted 6.9.0-syzkaller-07726-g3c999d1ae3c7 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:css_tryget include/linux/cgroup_refcnt.h:44 [inline]
RIP: 0010:get_mem_cgroup_from_objcg include/linux/memcontrol.h:536 [inline]
RIP: 0010:get_memcg.isra.0+0xde/0x5a0 kernel/bpf/memalloc.c:160
Code: df 4d 89 f4 49 c1 ec 03 4d 01 ec e8 ac e2 da ff 41 80 3c 24 00 0f 85 a2 04 00 00 48 8b 6b 10 48 8d 7d 54 48 89 f8 48 c1 e8 03 <42> 0f b6 14 28 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85
RSP: 0018:ffffc900005f0e58 EFLAGS: 00010007
RAX: 001ffff110036b12 RBX: ffff88801bcc4f81 RCX: ffffffff81b3a207
RDX: ffff88802535c880 RSI: ffffffff81b3a164 RDI: 00ffff88801b5894
RBP: 00ffff88801b5840 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffed10037989f2
R13: dffffc0000000000 R14: ffff88801bcc4f91 R15: 1ffffd1ff5a68bc4
FS:  0000000000000000(0000) GS:ffff88802c300000(0063) knlGS:00000000f5e88b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f73a3138 CR3: 000000001505e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <IRQ>
 alloc_bulk+0x2a2/0x600 kernel/bpf/memalloc.c:239
 bpf_mem_refill+0x5dd/0x9d0 kernel/bpf/memalloc.c:442
 irq_work_single+0x1bc/0x260 kernel/irq_work.c:221
 irq_work_run_list+0x92/0xc0 kernel/irq_work.c:252
 irq_work_run+0x58/0xd0 kernel/irq_work.c:261
 __sysvec_irq_work+0x8c/0x410 arch/x86/kernel/irq_work.c:22
 instr_sysvec_irq_work arch/x86/kernel/irq_work.c:17 [inline]
 sysvec_irq_work+0x90/0xb0 arch/x86/kernel/irq_work.c:17
 </IRQ>
 <TASK>
 asm_sysvec_irq_work+0x1a/0x20 arch/x86/include/asm/idtentry.h:738
RIP: 0010:htab_unlock_bucket kernel/bpf/hashtab.c:181 [inline]
RIP: 0010:__htab_percpu_map_update_elem+0x42a/0x990 kernel/bpf/hashtab.c:1319
Code: ff 4d 85 ff 0f 85 8d 01 00 00 e8 91 91 e2 ff 9c 5d 81 e5 00 02 00 00 31 ff 48 89 ee e8 8f 8c e2 ff 48 85 ed 0f 85 b8 03 00 00 <e8> 71 91 e2 ff bf 01 00 00 00 e8 57 74 b2 ff 31 ff 65 8b 2d d6 e4
RSP: 0018:ffffc90004c5f9f0 EFLAGS: 00000283
RAX: 0000000000001907 RBX: 0000000000000000 RCX: ffffc9002b201000
RDX: 0000000000040000 RSI: ffffffff81abf431 RDI: 0000000000000007
RBP: 0000000000000000 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000001 R12: ffff888028aac000
R13: 0000000000000002 R14: 0000000000000001 R15: 0000000000000200
 bpf_percpu_hash_update+0xbb/0x240 kernel/bpf/hashtab.c:2424
 bpf_map_update_value+0x3e1/0x6c0 kernel/bpf/syscall.c:181
 generic_map_update_batch+0x454/0x5f0 kernel/bpf/syscall.c:1889
 bpf_map_do_batch+0x615/0x6e0 kernel/bpf/syscall.c:5196
 __sys_bpf+0x1906/0x58f0 kernel/bpf/syscall.c:5751
 __do_sys_bpf kernel/bpf/syscall.c:5794 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5792 [inline]
 __ia32_sys_bpf+0x76/0xe0 kernel/bpf/syscall.c:5792
 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
 __do_fast_syscall_32+0x75/0x120 arch/x86/entry/common.c:386
 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e
RIP: 0023:0xf7296579
Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00
RSP: 002b:00000000f5e885ac EFLAGS: 00000292 ORIG_RAX: 0000000000000165
RAX: ffffffffffffffda RBX: 000000000000001a RCX: 0000000020000200
RDX: 0000000000000038 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:css_tryget include/linux/cgroup_refcnt.h:44 [inline]
RIP: 0010:get_mem_cgroup_from_objcg include/linux/memcontrol.h:536 [inline]
RIP: 0010:get_memcg.isra.0+0xde/0x5a0 kernel/bpf/memalloc.c:160
Code: df 4d 89 f4 49 c1 ec 03 4d 01 ec e8 ac e2 da ff 41 80 3c 24 00 0f 85 a2 04 00 00 48 8b 6b 10 48 8d 7d 54 48 89 f8 48 c1 e8 03 <42> 0f b6 14 28 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85
RSP: 0018:ffffc900005f0e58 EFLAGS: 00010007
RAX: 001ffff110036b12 RBX: ffff88801bcc4f81 RCX: ffffffff81b3a207
RDX: ffff88802535c880 RSI: ffffffff81b3a164 RDI: 00ffff88801b5894
RBP: 00ffff88801b5840 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffffed10037989f2
R13: dffffc0000000000 R14: ffff88801bcc4f91 R15: 1ffffd1ff5a68bc4
FS:  0000000000000000(0000) GS:ffff88802c300000(0063) knlGS:00000000f5e88b40
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 00000000f73a3138 CR3: 000000001505e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	df 4d 89             	fisttps -0x77(%rbp)
   3:	f4                   	hlt
   4:	49 c1 ec 03          	shr    $0x3,%r12
   8:	4d 01 ec             	add    %r13,%r12
   b:	e8 ac e2 da ff       	call   0xffdae2bc
  10:	41 80 3c 24 00       	cmpb   $0x0,(%r12)
  15:	0f 85 a2 04 00 00    	jne    0x4bd
  1b:	48 8b 6b 10          	mov    0x10(%rbx),%rbp
  1f:	48 8d 7d 54          	lea    0x54(%rbp),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 14 28       	movzbl (%rax,%r13,1),%edx <-- trapping instruction
  2f:	48 89 f8             	mov    %rdi,%rax
  32:	83 e0 07             	and    $0x7,%eax
  35:	83 c0 03             	add    $0x3,%eax
  38:	38 d0                	cmp    %dl,%al
  3a:	7c 08                	jl     0x44
  3c:	84 d2                	test   %dl,%dl
  3e:	0f                   	.byte 0xf
  3f:	85                   	.byte 0x85

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/16 12:08 upstream 3c999d1ae3c7 ef5d53ed .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in get_memcg
* Struck through repros no longer work on HEAD.