syzbot


kernel BUG in swap_cgroup_record

Status: upstream: reported syz repro on 2024/08/16 05:28
Subsystems: cgroups mm
[Documentation on labels]
Reported-by: syzbot+4745e725b07d34503a64@syzkaller.appspotmail.com
First crash: 31d, last: 26d
Cause bisection: introduced by (bisect log) :
commit d65aea610f0a14cda5ec56a154c724584ef7da17
Author: Barry Song <v-songbaohua@oppo.com>
Date: Wed Aug 7 21:58:59 2024 +0000

  mm: attempt to batch free swap entries for zap_pte_range()

Crash: kernel BUG in swap_cgroup_record (log)
Repro: syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [cgroups?] [mm?] kernel BUG in swap_cgroup_record 1 (2) 2024/08/16 05:48

Sample crash report:
------------[ cut here ]------------
kernel BUG at mm/swap_cgroup.c:141!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 UID: 0 PID: 5401 Comm: syz.0.15 Not tainted 6.11.0-rc3-next-20240816-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
RIP: 0010:swap_cgroup_record+0x2cd/0x2d0 mm/swap_cgroup.c:141
Code: e7 e8 a7 91 f6 ff e9 64 fe ff ff e8 ad db 8d ff 48 c7 c7 00 0f a6 8e 48 89 de e8 2e 42 e8 02 e9 7a fd ff ff e8 94 db 8d ff 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f
RSP: 0018:ffffc900034272d8 EFLAGS: 00010093
RAX: ffffffff8205b7dc RBX: 000000000000000b RCX: ffff888078ddbc00
RDX: 0000000000000000 RSI: 000000000000000a RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff8205b683 R09: fffff52000684e38
R10: dffffc0000000000 R11: fffff52000684e38 R12: ffff88807afea014
R13: 0000000000000000 R14: 000000000000000a R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fddce917a8c CR3: 000000000e736000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __mem_cgroup_uncharge_swap+0x84/0x2e0 mm/memcontrol.c:5132
 mem_cgroup_uncharge_swap include/linux/swap.h:668 [inline]
 swap_entry_range_free+0x45f/0x1120 mm/swapfile.c:1556
 __swap_entries_free mm/swapfile.c:1518 [inline]
 free_swap_and_cache_nr+0xa65/0xae0 mm/swapfile.c:1876
 zap_pte_range mm/memory.c:1653 [inline]
 zap_pmd_range mm/memory.c:1736 [inline]
 zap_pud_range mm/memory.c:1765 [inline]
 zap_p4d_range mm/memory.c:1786 [inline]
 unmap_page_range+0x1924/0x42c0 mm/memory.c:1807
 unmap_vmas+0x3cc/0x5f0 mm/memory.c:1897
 exit_mmap+0x275/0xc40 mm/mmap.c:1921
 __mmput+0x115/0x390 kernel/fork.c:1347
 exit_mm+0x220/0x310 kernel/exit.c:571
 do_exit+0x9b2/0x28e0 kernel/exit.c:926
 do_group_exit+0x207/0x2c0 kernel/exit.c:1088
 __do_sys_exit_group kernel/exit.c:1099 [inline]
 __se_sys_exit_group kernel/exit.c:1097 [inline]
 __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1097
 x64_sys_call+0x26a8/0x26b0 arch/x86/include/generated/asm/syscalls_64.h:232
 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:0x7fddce779e79
Code: Unable to access opcode bytes at 0x7fddce779e4f.
RSP: 002b:00007ffdbfa307b8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fddce779e79
RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000003 R08: 00007ffdbfa3089f R09: 00007fddce8e5260
R10: 0000000000000001 R11: 0000000000000246 R12: 00007fddce8e5f68
R13: 00007fddce8e5260 R14: 0000000000000003 R15: 00007ffdbfa30860
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:swap_cgroup_record+0x2cd/0x2d0 mm/swap_cgroup.c:141
Code: e7 e8 a7 91 f6 ff e9 64 fe ff ff e8 ad db 8d ff 48 c7 c7 00 0f a6 8e 48 89 de e8 2e 42 e8 02 e9 7a fd ff ff e8 94 db 8d ff 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 66 0f 1f
RSP: 0018:ffffc900034272d8 EFLAGS: 00010093
RAX: ffffffff8205b7dc RBX: 000000000000000b RCX: ffff888078ddbc00
RDX: 0000000000000000 RSI: 000000000000000a RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff8205b683 R09: fffff52000684e38
R10: dffffc0000000000 R11: fffff52000684e38 R12: ffff88807afea014
R13: 0000000000000000 R14: 000000000000000a R15: 0000000000000000
FS:  0000000000000000(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fddce917a8c CR3: 000000000e736000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/17 03:45 linux-next 367b5c3d53e5 76120936 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/17 03:18 linux-next 367b5c3d53e5 76120936 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/17 02:48 linux-next 367b5c3d53e5 76120936 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/12 16:20 linux-next 9e6869691724 6f4edef4 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/16 22:08 linux-next 367b5c3d53e5 76120936 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/16 22:07 linux-next 367b5c3d53e5 76120936 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/16 16:57 linux-next 367b5c3d53e5 76120936 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/15 12:47 linux-next edd1ec2e3a9f e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/14 03:18 linux-next 033a4691702c bde81f6f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
2024/08/12 05:22 linux-next 9e6869691724 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in swap_cgroup_record
* Struck through repros no longer work on HEAD.