syzbot


general protection fault in __mod_memcg_state

Status: moderation: reported on 2024/06/26 10:12
Subsystems: cgroups mm
[Documentation on labels]
Reported-by: syzbot+549d522e49952fee8395@syzkaller.appspotmail.com
First crash: 20d, last: 20d

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xf17ffc1ffff11005: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range [0x8c0000ffff888028-0x8c0000ffff88802f]
CPU: 1 PID: 10745 Comm: syz-executor.2 Not tainted 6.10.0-rc4-syzkaller-00217-g35bb670d65fc #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:memcg_rstat_updated mm/memcontrol.c:858 [inline]
RIP: 0010:__mod_memcg_state+0x20d/0x460 mm/memcontrol.c:970
Code: 48 8d 7b 08 48 89 f8 48 c1 e8 03 42 80 3c 30 00 0f 85 6a 01 00 00 48 8b 5b 08 48 85 db 0f 84 f5 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 0c 30 48 89 d8 83 e0 07 83 c0 03 38 c8 7c 08 84 c9 0f 85
RSP: 0018:ffffc900033c7c90 EFLAGS: 00010807
RAX: 1180001ffff11005 RBX: 8c0000ffff88802c RCX: 0000000000000000
RDX: 1ffffffff1a92f69 RSI: ffffffff8b8fc860 RDI: ffffe8ffad17160b
RBP: 0000000000000003 R08: 0000000000000000 R09: ffffed1005825aac
R10: ffff88802c12d563 R11: 0000000000000000 R12: 0000000000000003
R13: 1ffffffff1fc5b5e R14: dffffc0000000000 R15: 000000000000001f
FS:  0000000000000000(0000) GS:ffff88802c100000(0063) knlGS:00000000582cf400
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 000000003092b000 CR3: 000000002159e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 00000000e08e000e DR6: 00000000ffff0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 mod_memcg_state include/linux/memcontrol.h:1004 [inline]
 memcg_account_kmem+0x54/0x80 mm/memcontrol.c:3372
 obj_cgroup_uncharge_pages mm/memcontrol.c:3394 [inline]
 refill_obj_stock+0x37b/0x670 mm/memcontrol.c:3665
 obj_cgroup_uncharge mm/memcontrol.c:3714 [inline]
 __memcg_slab_free_hook+0x229/0x5a0 mm/memcontrol.c:3801
 memcg_slab_free_hook mm/slub.c:2130 [inline]
 slab_free mm/slub.c:4434 [inline]
 kfree+0x364/0x3b0 mm/slub.c:4558
 kvfree+0x47/0x50 mm/util.c:680
 seq_release+0x51/0x80 fs/seq_file.c:355
 kernfs_fop_release+0xfa/0x1f0 fs/kernfs/file.c:766
 __fput+0x408/0xbb0 fs/file_table.c:422
 __fput_sync+0x47/0x50 fs/file_table.c:507
 __do_sys_close fs/open.c:1555 [inline]
 __se_sys_close fs/open.c:1540 [inline]
 __ia32_sys_close+0x86/0x100 fs/open.c:1540
 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline]
 __do_fast_syscall_32+0x73/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:0xf72ba579
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:00000000fff5be90 EFLAGS: 00000293 ORIG_RAX: 0000000000000006
RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000582cf400
RDX: 0000000000000000 RSI: 00000000f7410ff4 RDI: 0000000000046e8d
RBP: 00000000f74380c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:memcg_rstat_updated mm/memcontrol.c:858 [inline]
RIP: 0010:__mod_memcg_state+0x20d/0x460 mm/memcontrol.c:970
Code: 48 8d 7b 08 48 89 f8 48 c1 e8 03 42 80 3c 30 00 0f 85 6a 01 00 00 48 8b 5b 08 48 85 db 0f 84 f5 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 0c 30 48 89 d8 83 e0 07 83 c0 03 38 c8 7c 08 84 c9 0f 85
RSP: 0018:ffffc900033c7c90 EFLAGS: 00010807
RAX: 1180001ffff11005 RBX: 8c0000ffff88802c RCX: 0000000000000000
RDX: 1ffffffff1a92f69 RSI: ffffffff8b8fc860 RDI: ffffe8ffad17160b
RBP: 0000000000000003 R08: 0000000000000000 R09: ffffed1005825aac
R10: ffff88802c12d563 R11: 0000000000000000 R12: 0000000000000003
R13: 1ffffffff1fc5b5e R14: dffffc0000000000 R15: 000000000000001f
FS:  0000000000000000(0000) GS:ffff88802c100000(0063) knlGS:00000000582cf400
CS:  0010 DS: 002b ES: 002b CR0: 0000000080050033
CR2: 000000003092b000 CR3: 000000002159e000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 00000000e08e000e DR6: 00000000ffff0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 8d 7b 08          	lea    0x8(%rbx),%rdi
   4:	48 89 f8             	mov    %rdi,%rax
   7:	48 c1 e8 03          	shr    $0x3,%rax
   b:	42 80 3c 30 00       	cmpb   $0x0,(%rax,%r14,1)
  10:	0f 85 6a 01 00 00    	jne    0x180
  16:	48 8b 5b 08          	mov    0x8(%rbx),%rbx
  1a:	48 85 db             	test   %rbx,%rbx
  1d:	0f 84 f5 00 00 00    	je     0x118
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 0c 30       	movzbl (%rax,%r14,1),%ecx <-- trapping instruction
  2f:	48 89 d8             	mov    %rbx,%rax
  32:	83 e0 07             	and    $0x7,%eax
  35:	83 c0 03             	add    $0x3,%eax
  38:	38 c8                	cmp    %cl,%al
  3a:	7c 08                	jl     0x44
  3c:	84 c9                	test   %cl,%cl
  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/06/22 10:03 upstream 35bb670d65fc c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in __mod_memcg_state
* Struck through repros no longer work on HEAD.