[syzbot] BUG: unable to handle kernel paging request in mem_cgroup_track_foreign_dirty_slowpath

From: syzbot
Date: Fri Sep 02 2022 - 17:03:13 EST


Hello,

syzbot found the following issue on:

HEAD commit: 85413d1e802e Merge branch 'for-next/fixes' into for-kernelci
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=108cec3b080000
kernel config: https://syzkaller.appspot.com/x/.config?x=57b9bfeca947ab90
dashboard link: https://syzkaller.appspot.com/bug?extid=66ad6d47392c3113957e
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14a3b1e5080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16dead7d080000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+66ad6d47392c3113957e@xxxxxxxxxxxxxxxxxxxxxxxxx

Unable to handle kernel paging request at virtual address 00000000000012e8
Mem abort info:
ESR = 0x0000000096000006
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
Data abort info:
ISV = 0, ISS = 0x00000006
CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=000000011163c000
[00000000000012e8] pgd=080000011204a003, p4d=080000011204a003, pud=080000011068f003, pmd=0000000000000000
Internal error: Oops: 96000006 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 926 Comm: syz-executor308 Not tainted 6.0.0-rc3-syzkaller-16800-g85413d1e802e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
pstate: 204000c5 (nzCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : mem_cgroup_track_foreign_dirty_slowpath+0x3c/0x1e4 mm/memcontrol.c:4595
lr : mem_cgroup_track_foreign_dirty_slowpath+0x38/0x1e4 mm/memcontrol.c:4586
sp : ffff800016c9ba80
x29: ffff800016c9ba80 x28: ffff0000d12cb500 x27: 0c00000000000001
x26: 0000000000000001 x25: ffff0000c017b000 x24: 0000000000000100
x23: ffff80000d379000 x22: 00000001000233ce x21: fffffc0003463000
x20: ffff0000c3849060 x19: 0000000000000000 x18: 000000000000013a
x17: ffff80000c04d6bc x16: ffff80000dbb8658 x15: ffff0000d12cb500
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000d12cb500
x11: ff808000095ecd98 x10: 0000000000000000 x9 : 0000000000000000
x8 : ffff0000c3849000 x7 : ffff80000856f3a4 x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000000 x3 : 0000000000000002
x2 : 0000000000000010 x1 : ffff80000cb90d29 x0 : 0000000000000001
Call trace:
mem_cgroup_track_foreign_dirty_slowpath+0x3c/0x1e4
mem_cgroup_track_foreign_dirty include/linux/memcontrol.h:1663 [inline]
folio_account_dirtied+0x430/0x650 mm/page-writeback.c:2575
__folio_mark_dirty+0xbc/0x180 mm/page-writeback.c:2615
block_dirty_folio+0x10c/0x1ec fs/buffer.c:640
folio_mark_dirty+0xbc/0x208 mm/page-writeback.c:2748
filemap_page_mkwrite+0x26c/0x5dc mm/filemap.c:3418
do_page_mkwrite+0x74/0x288 mm/memory.c:2971
wp_page_shared+0x8c/0x4e4 mm/memory.c:3316
do_wp_page+0x86c/0x110c mm/memory.c:3466
handle_pte_fault mm/memory.c:4929 [inline]
__handle_mm_fault mm/memory.c:5053 [inline]
handle_mm_fault+0x878/0xa40 mm/memory.c:5151
__do_page_fault arch/arm64/mm/fault.c:502 [inline]
do_page_fault+0x428/0x79c arch/arm64/mm/fault.c:602
do_mem_abort+0x54/0x130 arch/arm64/mm/fault.c:818
el0_da+0x70/0x16c arch/arm64/kernel/entry-common.c:502
el0t_64_sync_handler+0xcc/0xf0 arch/arm64/kernel/entry-common.c:645
el0t_64_sync+0x18c/0x190
Code: aa1503e0 aa1403e1 9400006c f9400288 (f9497669)
---[ end trace 0000000000000000 ]---
----------------
Code disassembly (best guess):
0: aa1503e0 mov x0, x21
4: aa1403e1 mov x1, x20
8: 9400006c bl 0x1b8
c: f9400288 ldr x8, [x20]
* 10: f9497669 ldr x9, [x19, #4840] <-- trapping instruction


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches