memory leak in ext4_multi_mount_protect

39 views
Skip to first unread message

syzbot

unread,
Dec 24, 2020, 4:55:19 AM12/24/20
to adilger...@dilger.ca, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, ty...@mit.edu
Hello,

syzbot found the following issue on:

HEAD commit: 467f8165 Merge tag 'close-range-cloexec-unshare-v5.11' of ..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12b7fccb500000
kernel config: https://syzkaller.appspot.com/x/.config?x=37c889fb8b2761af
dashboard link: https://syzkaller.appspot.com/bug?extid=d9e482e303930fa4f6ff
compiler: gcc (GCC) 10.1.0-syz 20200507
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1230f8a7500000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d9e482...@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0xffff88812560f120 (size 32):
comm "syz-executor.3", pid 11391, jiffies 4294966956 (age 10.520s)
hex dump (first 32 bytes):
28 2a e4 20 81 88 ff ff 00 f8 32 24 81 88 ff ff (*. ......2$....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<000000001fd6256c>] kmalloc include/linux/slab.h:552 [inline]
[<000000001fd6256c>] ext4_multi_mount_protect+0x4a6/0x5d0 fs/ext4/mmp.c:367
[<00000000ab3084f2>] ext4_fill_super+0x551e/0x5ac0 fs/ext4/super.c:4779
[<00000000b7304a28>] mount_bdev+0x223/0x260 fs/super.c:1366
[<00000000b580b323>] legacy_get_tree+0x2b/0x90 fs/fs_context.c:592
[<000000005310f7d7>] vfs_get_tree+0x28/0x100 fs/super.c:1496
[<000000006fc429ab>] do_new_mount fs/namespace.c:2875 [inline]
[<000000006fc429ab>] path_mount+0xc5e/0x1170 fs/namespace.c:3205
[<000000004f8c23d3>] do_mount fs/namespace.c:3218 [inline]
[<000000004f8c23d3>] __do_sys_mount fs/namespace.c:3426 [inline]
[<000000004f8c23d3>] __se_sys_mount fs/namespace.c:3403 [inline]
[<000000004f8c23d3>] __x64_sys_mount+0x18e/0x1d0 fs/namespace.c:3403
[<000000002cff8f95>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
[<00000000779cd3d5>] entry_SYSCALL_64_after_hwframe+0x44/0xa9



---
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 syzk...@googlegroups.com.

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

syzbot

unread,
Apr 9, 2021, 1:43:20 AM4/9/21
to adilger...@dilger.ca, juan....@b2bworthyleads.com, linux...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, ty...@mit.edu
syzbot has found a reproducer for the following issue on:

HEAD commit: 4fa56ad0 Merge tag 'for-linus' of git://git.kernel.org/pub..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12390a96d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=b8dbd3c72fdc7777
dashboard link: https://syzkaller.appspot.com/bug?extid=d9e482e303930fa4f6ff
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=109aaa7ed00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16e77d16d00000

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d9e482...@syzkaller.appspotmail.com

executing program
BUG: memory leak
unreferenced object 0xffff888111edd780 (size 32):
comm "syz-executor633", pid 8448, jiffies 4294951405 (age 17.620s)
hex dump (first 32 bytes):
10 64 d1 0f 81 88 ff ff 00 10 7e 12 81 88 ff ff .d........~.....
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff81744606>] kmalloc include/linux/slab.h:554 [inline]
[<ffffffff81744606>] ext4_multi_mount_protect+0x4a6/0x5d0 fs/ext4/mmp.c:367
[<ffffffff81783614>] ext4_fill_super+0x56a4/0x5b20 fs/ext4/super.c:4769
[<ffffffff8154ebf3>] mount_bdev+0x223/0x260 fs/super.c:1367
[<ffffffff815aee7b>] legacy_get_tree+0x2b/0x90 fs/fs_context.c:592
[<ffffffff8154c7e8>] vfs_get_tree+0x28/0x100 fs/super.c:1497
[<ffffffff8158c8ee>] do_new_mount fs/namespace.c:2903 [inline]
[<ffffffff8158c8ee>] path_mount+0xc3e/0x1120 fs/namespace.c:3233
[<ffffffff8158d51e>] do_mount fs/namespace.c:3246 [inline]
[<ffffffff8158d51e>] __do_sys_mount fs/namespace.c:3454 [inline]
[<ffffffff8158d51e>] __se_sys_mount fs/namespace.c:3431 [inline]
[<ffffffff8158d51e>] __x64_sys_mount+0x18e/0x1d0 fs/namespace.c:3431
[<ffffffff842ded2d>] do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
[<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae


syzbot

unread,
Apr 12, 2021, 8:28:13 PM4/12/21
to paskr...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+d9e482...@syzkaller.appspotmail.com

Tested on:

commit: ba2d9bef ext4: fix memory leak in ext4_fill_super
git tree: https://linux.googlesource.com/linux/kernel/git/torvalds/linux refs/changes/76/10176/1
kernel config: https://syzkaller.appspot.com/x/.config?x=bea6e63822ded373
Note: testing is done by a robot and is best-effort only.

Jules Irenge

unread,
Apr 15, 2021, 7:54:19 AM4/15/21
to syzkaller-bugs
I got that too but not with a lot of details as you do.

Pavel Skripkin

unread,
Apr 19, 2021, 4:31:46 PM4/19/21
to syzkaller-bugs
Hi!

I'm not sure about this patch, because I did't find any kernel examples
like this. Maybe it's not the proper way of fixing this problem.

I sent an email to ext4 maintainers, but they have not yet responded :(
Reply all
Reply to author
Forward
0 new messages