Re: [syzbot] memory leak in __get_metapage

From: syzbot
Date: Tue Oct 11 2022 - 07:00:43 EST


Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
memory leak in __get_metapage

BUG: memory leak
unreferenced object 0xffff888115b53800 (size 128):
comm "syz-executor.0", pid 4198, jiffies 4294944352 (age 13.760s)
hex dump (first 32 bytes):
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8148f373>] mempool_alloc+0x73/0x230 mm/mempool.c:392
[<ffffffff81c4f24e>] alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
[<ffffffff81c4f24e>] __get_metapage+0x3ae/0xae0 fs/jfs/jfs_metapage.c:651
[<ffffffff81c37cc2>] diNewExt+0x3f2/0x9d0 fs/jfs/jfs_imap.c:2265
[<ffffffff81c396b4>] diAllocExt fs/jfs/jfs_imap.c:1945 [inline]
[<ffffffff81c396b4>] diAllocAG+0x9a4/0xd50 fs/jfs/jfs_imap.c:1662
[<ffffffff81c3b4df>] diAlloc+0x31f/0x900 fs/jfs/jfs_imap.c:1583
[<ffffffff81c4c1da>] ialloc+0x6a/0x3a0 fs/jfs/jfs_inode.c:56
[<ffffffff81c2e937>] jfs_mkdir+0xf7/0x480 fs/jfs/namei.c:225
[<ffffffff815f0df3>] vfs_mkdir+0x223/0x340 fs/namei.c:4035
[<ffffffff815f9d65>] do_mkdirat+0x1a5/0x1e0 fs/namei.c:4060
[<ffffffff815f9ed9>] __do_sys_mkdir fs/namei.c:4080 [inline]
[<ffffffff815f9ed9>] __se_sys_mkdir fs/namei.c:4078 [inline]
[<ffffffff815f9ed9>] __x64_sys_mkdir+0x69/0x90 fs/namei.c:4078
[<ffffffff845fee85>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff845fee85>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84800087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

BUG: memory leak
unreferenced object 0xffff888115b53880 (size 128):
comm "syz-executor.0", pid 4198, jiffies 4294944352 (age 13.760s)
hex dump (first 32 bytes):
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8148f373>] mempool_alloc+0x73/0x230 mm/mempool.c:392
[<ffffffff81c4f24e>] alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
[<ffffffff81c4f24e>] __get_metapage+0x3ae/0xae0 fs/jfs/jfs_metapage.c:651
[<ffffffff81c37cc2>] diNewExt+0x3f2/0x9d0 fs/jfs/jfs_imap.c:2265
[<ffffffff81c396b4>] diAllocExt fs/jfs/jfs_imap.c:1945 [inline]
[<ffffffff81c396b4>] diAllocAG+0x9a4/0xd50 fs/jfs/jfs_imap.c:1662
[<ffffffff81c3b4df>] diAlloc+0x31f/0x900 fs/jfs/jfs_imap.c:1583
[<ffffffff81c4c1da>] ialloc+0x6a/0x3a0 fs/jfs/jfs_inode.c:56
[<ffffffff81c2e937>] jfs_mkdir+0xf7/0x480 fs/jfs/namei.c:225
[<ffffffff815f0df3>] vfs_mkdir+0x223/0x340 fs/namei.c:4035
[<ffffffff815f9d65>] do_mkdirat+0x1a5/0x1e0 fs/namei.c:4060
[<ffffffff815f9ed9>] __do_sys_mkdir fs/namei.c:4080 [inline]
[<ffffffff815f9ed9>] __se_sys_mkdir fs/namei.c:4078 [inline]
[<ffffffff815f9ed9>] __x64_sys_mkdir+0x69/0x90 fs/namei.c:4078
[<ffffffff845fee85>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff845fee85>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84800087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

BUG: memory leak
unreferenced object 0xffff888115b53900 (size 128):
comm "syz-executor.0", pid 4198, jiffies 4294944352 (age 13.760s)
hex dump (first 32 bytes):
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8148f373>] mempool_alloc+0x73/0x230 mm/mempool.c:392
[<ffffffff81c4f24e>] alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
[<ffffffff81c4f24e>] __get_metapage+0x3ae/0xae0 fs/jfs/jfs_metapage.c:651
[<ffffffff81c37cc2>] diNewExt+0x3f2/0x9d0 fs/jfs/jfs_imap.c:2265
[<ffffffff81c396b4>] diAllocExt fs/jfs/jfs_imap.c:1945 [inline]
[<ffffffff81c396b4>] diAllocAG+0x9a4/0xd50 fs/jfs/jfs_imap.c:1662
[<ffffffff81c3b4df>] diAlloc+0x31f/0x900 fs/jfs/jfs_imap.c:1583
[<ffffffff81c4c1da>] ialloc+0x6a/0x3a0 fs/jfs/jfs_inode.c:56
[<ffffffff81c2e937>] jfs_mkdir+0xf7/0x480 fs/jfs/namei.c:225
[<ffffffff815f0df3>] vfs_mkdir+0x223/0x340 fs/namei.c:4035
[<ffffffff815f9d65>] do_mkdirat+0x1a5/0x1e0 fs/namei.c:4060
[<ffffffff815f9ed9>] __do_sys_mkdir fs/namei.c:4080 [inline]
[<ffffffff815f9ed9>] __se_sys_mkdir fs/namei.c:4078 [inline]
[<ffffffff815f9ed9>] __x64_sys_mkdir+0x69/0x90 fs/namei.c:4078
[<ffffffff845fee85>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff845fee85>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84800087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

BUG: memory leak
unreferenced object 0xffff888116622700 (size 128):
comm "syz-executor.0", pid 4739, jiffies 4294944954 (age 7.740s)
hex dump (first 32 bytes):
00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8148f373>] mempool_alloc+0x73/0x230 mm/mempool.c:392
[<ffffffff81c4f24e>] alloc_metapage fs/jfs/jfs_metapage.c:176 [inline]
[<ffffffff81c4f24e>] __get_metapage+0x3ae/0xae0 fs/jfs/jfs_metapage.c:651
[<ffffffff81c37cc2>] diNewExt+0x3f2/0x9d0 fs/jfs/jfs_imap.c:2265
[<ffffffff81c396b4>] diAllocExt fs/jfs/jfs_imap.c:1945 [inline]
[<ffffffff81c396b4>] diAllocAG+0x9a4/0xd50 fs/jfs/jfs_imap.c:1662
[<ffffffff81c3b4df>] diAlloc+0x31f/0x900 fs/jfs/jfs_imap.c:1583
[<ffffffff81c4c1da>] ialloc+0x6a/0x3a0 fs/jfs/jfs_inode.c:56
[<ffffffff81c2e937>] jfs_mkdir+0xf7/0x480 fs/jfs/namei.c:225
[<ffffffff815f0df3>] vfs_mkdir+0x223/0x340 fs/namei.c:4035
[<ffffffff815f9d65>] do_mkdirat+0x1a5/0x1e0 fs/namei.c:4060
[<ffffffff815f9ed9>] __do_sys_mkdir fs/namei.c:4080 [inline]
[<ffffffff815f9ed9>] __se_sys_mkdir fs/namei.c:4078 [inline]
[<ffffffff815f9ed9>] __x64_sys_mkdir+0x69/0x90 fs/namei.c:4078
[<ffffffff845fee85>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]
[<ffffffff845fee85>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
[<ffffffff84800087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd



Tested on:

commit: 60bb8154 Merge tag 'xfs-6.1-for-linus' of git://git.ke..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git --
console output: https://syzkaller.appspot.com/x/log.txt?x=171a96dc880000
kernel config: https://syzkaller.appspot.com/x/.config?x=589d84e4754dd2fa
dashboard link: https://syzkaller.appspot.com/bug?extid=389b82b29093b3e2640a
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=1095fc78880000