syzbot


memory leak in xas_nomem

Status: fixed on 2023/02/24 13:50
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+9e27a75a8c24f3fe75c1@syzkaller.appspotmail.com
Fix commit: 69a37a8ba1b4 mm/huge_memory: Fix xarray node memory leak
First crash: 762d, last: 762d
Discussions (3)
Title Replies (including bot) Last reply
[PATCH 5.18 000/339] 5.18.4-rc1 review 342 (342) 2022/06/14 07:23
[PATCH 5.17 000/298] 5.17.15-rc1 review 299 (299) 2022/06/13 10:13
[syzbot] memory leak in xas_nomem 3 (5) 2022/06/08 19:54
Last patch testing requests (1)
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):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/05/24 03:16 upstream 1e57930e9f40 e7f9308d .config console log report syz C ci-upstream-gce-leak memory leak in xas_nomem
* Struck through repros no longer work on HEAD.