syzbot


memory leak in xas_nomem

Status: upstream: reported C repro on 2022/05/28 03:20
Reported-by: syzbot+9e27a75a8c24f3fe75c1@syzkaller.appspotmail.com
Fix commit: 69a37a8ba1b4 mm/huge_memory: Fix xarray node memory leak
Patched on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 250d, last: 250d
Last patch testing requests:
Created Duration User Patch Repo Result
2022/06/08 19:37 15m willy@infradead.org git://git.infradead.org/users/willy/pagecache.git for-next OK

Sample crash report:
BUG: memory leak
unreferenced object 0xffff88810cb35d80 (size 576):
  comm "syz-executor883", pid 3623, jiffies 4294954631 (age 23.510s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    18 48 36 04 81 88 ff ff 98 5d b3 0c 81 88 ff ff  .H6......]......
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb39d80 (size 576):
  comm "syz-executor883", pid 3622, jiffies 4294954659 (age 23.230s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    98 f8 cd 0d 81 88 ff ff 98 9d b3 0c 81 88 ff ff  ................
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb35d80 (size 576):
  comm "syz-executor883", pid 3623, jiffies 4294954631 (age 29.410s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    18 48 36 04 81 88 ff ff 98 5d b3 0c 81 88 ff ff  .H6......]......
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb39d80 (size 576):
  comm "syz-executor883", pid 3622, jiffies 4294954659 (age 29.130s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    98 f8 cd 0d 81 88 ff ff 98 9d b3 0c 81 88 ff ff  ................
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb35d80 (size 576):
  comm "syz-executor883", pid 3623, jiffies 4294954631 (age 29.450s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    18 48 36 04 81 88 ff ff 98 5d b3 0c 81 88 ff ff  .H6......]......
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb39d80 (size 576):
  comm "syz-executor883", pid 3622, jiffies 4294954659 (age 29.170s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    98 f8 cd 0d 81 88 ff ff 98 9d b3 0c 81 88 ff ff  ................
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb35d80 (size 576):
  comm "syz-executor883", pid 3623, jiffies 4294954631 (age 29.490s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    18 48 36 04 81 88 ff ff 98 5d b3 0c 81 88 ff ff  .H6......]......
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

BUG: memory leak
unreferenced object 0xffff88810cb39d80 (size 576):
  comm "syz-executor883", pid 3622, jiffies 4294954659 (age 29.210s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    98 f8 cd 0d 81 88 ff ff 98 9d b3 0c 81 88 ff ff  ................
  backtrace:
    [<ffffffff8247dfba>] xas_nomem lib/xarray.c:307 [inline]
    [<ffffffff8247dfba>] xas_nomem+0x4a/0xd0 lib/xarray.c:299
    [<ffffffff8157b8d0>] split_huge_page_to_list+0x26d0/0x29f0 mm/huge_memory.c:2626
    [<ffffffff8148a224>] split_huge_page include/linux/huge_mm.h:191 [inline]
    [<ffffffff8148a224>] truncate_inode_partial_folio+0x3e4/0x5f0 mm/truncate.c:243
    [<ffffffff814a78a0>] shmem_undo_range+0x3d0/0xbe0 mm/shmem.c:966
    [<ffffffff814a8e51>] shmem_truncate_range mm/shmem.c:1044 [inline]
    [<ffffffff814a8e51>] shmem_fallocate+0x1e1/0x910 mm/shmem.c:2671
    [<ffffffff815b5c6c>] vfs_fallocate+0x31c/0x670 fs/open.c:308
    [<ffffffff815237e3>] madvise_remove mm/madvise.c:965 [inline]
    [<ffffffff815237e3>] madvise_vma_behavior+0x7d3/0x1000 mm/madvise.c:989
    [<ffffffff8151f2fc>] madvise_walk_vmas+0x11c/0x1d0 mm/madvise.c:1221
    [<ffffffff8152437b>] do_madvise mm/madvise.c:1399 [inline]
    [<ffffffff8152437b>] do_madvise+0x23b/0x320 mm/madvise.c:1357
    [<ffffffff8152478a>] __do_sys_madvise mm/madvise.c:1412 [inline]
    [<ffffffff8152478a>] __se_sys_madvise mm/madvise.c:1410 [inline]
    [<ffffffff8152478a>] __x64_sys_madvise+0x2a/0x30 mm/madvise.c:1410
    [<ffffffff84565f15>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
    [<ffffffff84565f15>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
    [<ffffffff84600068>] entry_SYSCALL_64_after_hwframe+0x44/0xae

executing program
executing program
executing program
executing program

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-gce-leak 2022/05/24 03:16 upstream 1e57930e9f40 e7f9308d .config console log report syz C memory leak in xas_nomem
* Struck through repros no longer work on HEAD.