* [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod
@ 2023-08-15 9:15 syzbot
2023-11-12 9:17 ` [syzbot] " syzbot
` (6 more replies)
0 siblings, 7 replies; 15+ messages in thread
From: syzbot @ 2023-08-15 9:15 UTC (permalink / raw)
To: clm, dsterba, josef, linux-btrfs, linux-fsdevel, linux-kernel,
syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 25aa0bebba72 Merge tag 'net-6.5-rc6' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=169577fda80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4
dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148191c3a80000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/76b0857d2814/disk-25aa0beb.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a01574755257/vmlinux-25aa0beb.xz
kernel image: https://storage.googleapis.com/syzbot-assets/262002db770e/bzImage-25aa0beb.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b93cffaa6717/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com
BUG: memory leak
unreferenced object 0xffff888129851240 (size 64):
comm "syz-executor.0", pid 5069, jiffies 4294977377 (age 16.480s)
hex dump (first 32 bytes):
01 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 00 ................
backtrace:
[<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076
[<ffffffff821731b1>] kmalloc include/linux/slab.h:582 [inline]
[<ffffffff821731b1>] btrfs_ref_tree_mod+0x211/0xb80 fs/btrfs/ref-verify.c:768
[<ffffffff820444f6>] btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250
[<ffffffff8202d775>] __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601
[<ffffffff8202dc54>] btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712
[<ffffffff8206013c>] commit_cowonly_roots+0x8c/0x3f0 fs/btrfs/transaction.c:1276
[<ffffffff820647c9>] btrfs_commit_transaction+0x999/0x15c0 fs/btrfs/transaction.c:2410
[<ffffffff8205a516>] btrfs_commit_super+0x86/0xb0 fs/btrfs/disk-io.c:4195
[<ffffffff8205c743>] close_ctree+0x543/0x730 fs/btrfs/disk-io.c:4349
[<ffffffff8166b44e>] generic_shutdown_super+0x9e/0x1c0 fs/super.c:499
[<ffffffff8166b769>] kill_anon_super+0x19/0x30 fs/super.c:1110
[<ffffffff8202357d>] btrfs_kill_super+0x1d/0x30 fs/btrfs/super.c:2138
[<ffffffff8166ca46>] deactivate_locked_super+0x46/0xd0 fs/super.c:330
[<ffffffff8166cb6c>] deactivate_super fs/super.c:361 [inline]
[<ffffffff8166cb6c>] deactivate_super+0x9c/0xb0 fs/super.c:357
[<ffffffff816a8931>] cleanup_mnt+0x121/0x210 fs/namespace.c:1254
[<ffffffff812becaf>] task_work_run+0x8f/0xe0 kernel/task_work.c:179
---
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@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [syzbot] Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot @ 2023-11-12 9:17 ` syzbot 2023-11-12 9:33 ` syzbot ` (5 subsequent siblings) 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 9:17 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod Author: bragathemanick0908@gmail.com On 15/08/23 14:45, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 25aa0bebba72 Merge tag 'net-6.5-rc6' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=169577fda80000 > kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 > dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148191c3a80000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/76b0857d2814/disk-25aa0beb.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/a01574755257/vmlinux-25aa0beb.xz > kernel image: https://storage.googleapis.com/syzbot-assets/262002db770e/bzImage-25aa0beb.xz > mounted in repro: https://storage.googleapis.com/syzbot-assets/b93cffaa6717/mount_0.gz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com > > BUG: memory leak > unreferenced object 0xffff888129851240 (size 64): > comm "syz-executor.0", pid 5069, jiffies 4294977377 (age 16.480s) > hex dump (first 32 bytes): > 01 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 00 ................ > backtrace: > [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 > [<ffffffff821731b1>] kmalloc include/linux/slab.h:582 [inline] > [<ffffffff821731b1>] btrfs_ref_tree_mod+0x211/0xb80 fs/btrfs/ref-verify.c:768 > [<ffffffff820444f6>] btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250 > [<ffffffff8202d775>] __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601 > [<ffffffff8202dc54>] btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712 > [<ffffffff8206013c>] commit_cowonly_roots+0x8c/0x3f0 fs/btrfs/transaction.c:1276 > [<ffffffff820647c9>] btrfs_commit_transaction+0x999/0x15c0 fs/btrfs/transaction.c:2410 > [<ffffffff8205a516>] btrfs_commit_super+0x86/0xb0 fs/btrfs/disk-io.c:4195 > [<ffffffff8205c743>] close_ctree+0x543/0x730 fs/btrfs/disk-io.c:4349 > [<ffffffff8166b44e>] generic_shutdown_super+0x9e/0x1c0 fs/super.c:499 > [<ffffffff8166b769>] kill_anon_super+0x19/0x30 fs/super.c:1110 > [<ffffffff8202357d>] btrfs_kill_super+0x1d/0x30 fs/btrfs/super.c:2138 > [<ffffffff8166ca46>] deactivate_locked_super+0x46/0xd0 fs/super.c:330 > [<ffffffff8166cb6c>] deactivate_super fs/super.c:361 [inline] > [<ffffffff8166cb6c>] deactivate_super+0x9c/0xb0 fs/super.c:357 > [<ffffffff816a8931>] cleanup_mnt+0x121/0x210 fs/namespace.c:1254 > [<ffffffff812becaf>] task_work_run+0x8f/0xe0 kernel/task_work.c:179 > > > > --- > 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@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the bug is already fixed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want syzbot to run the reproducer, reply with: > #syz test: git://repo/address.git branch-or-commit-hash > If you attach or paste a git patch, syzbot will apply it before testing. > > If you want to change bug's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the bug is a duplicate of another bug, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup > #syz test diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index 95d28497de7c..fbb24c65eeb0 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -791,6 +791,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } else if (be->num_refs == 0) { btrfs_err(fs_info, @@ -800,6 +801,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } @@ -822,6 +824,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } exist->num_refs--; @@ -838,6 +841,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } kfree(ref); @@ -849,6 +853,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } } @@ -881,6 +886,8 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, } list_add_tail(&ra->list, &be->actions); ret = 0; + kfree(ra); + kfree(re); out_unlock: spin_unlock(&fs_info->ref_verify_lock); out: ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [syzbot] Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot 2023-11-12 9:17 ` [syzbot] " syzbot @ 2023-11-12 9:33 ` syzbot 2023-11-12 10:16 ` syzbot ` (4 subsequent siblings) 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 9:33 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod Author: bragathemanick0908@gmail.com On 12/11/23 14:53, syzbot wrote: > Hello, > > syzbot tried to test the proposed patch but the build/boot failed: > > failed to apply patch: > checking file fs/btrfs/ref-verify.c > Hunk #1 FAILED at 791. > Hunk #2 FAILED at 800. > 2 out of 2 hunks FAILED > > > > Tested on: > > commit: 1b907d05 Merge tag '6.7-rc-smb3-client-fixes-part2' of.. > git tree: upstream > kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 > dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f > compiler: > patch: https://syzkaller.appspot.com/x/patch.diff?x=16845fe0e80000 > #syz test --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -791,6 +791,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } else if (be->num_refs == 0) { btrfs_err(fs_info, @@ -800,6 +801,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } @@ -822,6 +824,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } exist->num_refs--; @@ -838,6 +841,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } kfree(ref); @@ -849,6 +853,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } } @@ -881,6 +886,8 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, } list_add_tail(&ra->list, &be->actions); ret = 0; + kfree(ra); + kfree(re); out_unlock: spin_unlock(&fs_info->ref_verify_lock); out: ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot 2023-11-12 9:17 ` [syzbot] " syzbot 2023-11-12 9:33 ` syzbot @ 2023-11-12 10:16 ` syzbot 2023-11-12 11:04 ` syzbot ` (3 subsequent siblings) 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 10:16 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod Author: bragathemanick0908@gmail.com #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 25aa0bebba72 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -791,6 +791,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } else if (be->num_refs == 0) { btrfs_err(fs_info, @@ -800,6 +801,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } @@ -822,6 +824,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } exist->num_refs--; @@ -838,6 +841,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } kfree(ref); @@ -849,6 +853,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } } @@ -881,6 +886,8 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, } list_add_tail(&ra->list, &be->actions); ret = 0; + kfree(ra); + kfree(re); out_unlock: spin_unlock(&fs_info->ref_verify_lock); out: ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot ` (2 preceding siblings ...) 2023-11-12 10:16 ` syzbot @ 2023-11-12 11:04 ` syzbot 2023-11-12 13:08 ` Bragatheswaran Manickavel ` (2 subsequent siblings) 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 11:04 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod Author: bragathemanick0908@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 25aa0bebba72b318e71fe205bfd1236550cc9534 On 15/08/23 14:45, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 25aa0bebba72 Merge tag 'net-6.5-rc6' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=169577fda80000 > kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 > dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148191c3a80000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/76b0857d2814/disk-25aa0beb.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/a01574755257/vmlinux-25aa0beb.xz > kernel image: https://storage.googleapis.com/syzbot-assets/262002db770e/bzImage-25aa0beb.xz > mounted in repro: https://storage.googleapis.com/syzbot-assets/b93cffaa6717/mount_0.gz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com > > BUG: memory leak > unreferenced object 0xffff888129851240 (size 64): > comm "syz-executor.0", pid 5069, jiffies 4294977377 (age 16.480s) > hex dump (first 32 bytes): > 01 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 00 ................ > backtrace: > [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 > [<ffffffff821731b1>] kmalloc include/linux/slab.h:582 [inline] > [<ffffffff821731b1>] btrfs_ref_tree_mod+0x211/0xb80 fs/btrfs/ref-verify.c:768 > [<ffffffff820444f6>] btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250 > [<ffffffff8202d775>] __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601 > [<ffffffff8202dc54>] btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712 > [<ffffffff8206013c>] commit_cowonly_roots+0x8c/0x3f0 fs/btrfs/transaction.c:1276 > [<ffffffff820647c9>] btrfs_commit_transaction+0x999/0x15c0 fs/btrfs/transaction.c:2410 > [<ffffffff8205a516>] btrfs_commit_super+0x86/0xb0 fs/btrfs/disk-io.c:4195 > [<ffffffff8205c743>] close_ctree+0x543/0x730 fs/btrfs/disk-io.c:4349 > [<ffffffff8166b44e>] generic_shutdown_super+0x9e/0x1c0 fs/super.c:499 > [<ffffffff8166b769>] kill_anon_super+0x19/0x30 fs/super.c:1110 > [<ffffffff8202357d>] btrfs_kill_super+0x1d/0x30 fs/btrfs/super.c:2138 > [<ffffffff8166ca46>] deactivate_locked_super+0x46/0xd0 fs/super.c:330 > [<ffffffff8166cb6c>] deactivate_super fs/super.c:361 [inline] > [<ffffffff8166cb6c>] deactivate_super+0x9c/0xb0 fs/super.c:357 > [<ffffffff816a8931>] cleanup_mnt+0x121/0x210 fs/namespace.c:1254 > [<ffffffff812becaf>] task_work_run+0x8f/0xe0 kernel/task_work.c:179 > > > > --- > 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@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the bug is already fixed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want syzbot to run the reproducer, reply with: > #syz test: git://repo/address.git branch-or-commit-hash > If you attach or paste a git patch, syzbot will apply it before testing. > > If you want to change bug's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the bug is a duplicate of another bug, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot ` (3 preceding siblings ...) 2023-11-12 11:04 ` syzbot @ 2023-11-12 13:08 ` Bragatheswaran Manickavel 2023-11-12 13:45 ` syzbot 2023-11-13 9:44 ` [syzbot] " syzbot 2023-11-16 9:42 ` [syzbot] Re: [syzbot] [btrfs?] " syzbot 6 siblings, 1 reply; 15+ messages in thread From: Bragatheswaran Manickavel @ 2023-11-12 13:08 UTC (permalink / raw) To: syzbot, clm, dsterba, josef, linux-btrfs, linux-fsdevel, linux-kernel, syzkaller-bugs [-- Attachment #1: Type: text/plain, Size: 3906 bytes --] #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 25aa0bebba72b318e71fe205bfd1236550cc9534 On 15/08/23 14:45, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 25aa0bebba72 Merge tag 'net-6.5-rc6' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=169577fda80000 > kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 > dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148191c3a80000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/76b0857d2814/disk-25aa0beb.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/a01574755257/vmlinux-25aa0beb.xz > kernel image: https://storage.googleapis.com/syzbot-assets/262002db770e/bzImage-25aa0beb.xz > mounted in repro: https://storage.googleapis.com/syzbot-assets/b93cffaa6717/mount_0.gz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com > > BUG: memory leak > unreferenced object 0xffff888129851240 (size 64): > comm "syz-executor.0", pid 5069, jiffies 4294977377 (age 16.480s) > hex dump (first 32 bytes): > 01 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 00 ................ > backtrace: > [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 > [<ffffffff821731b1>] kmalloc include/linux/slab.h:582 [inline] > [<ffffffff821731b1>] btrfs_ref_tree_mod+0x211/0xb80 fs/btrfs/ref-verify.c:768 > [<ffffffff820444f6>] btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250 > [<ffffffff8202d775>] __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601 > [<ffffffff8202dc54>] btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712 > [<ffffffff8206013c>] commit_cowonly_roots+0x8c/0x3f0 fs/btrfs/transaction.c:1276 > [<ffffffff820647c9>] btrfs_commit_transaction+0x999/0x15c0 fs/btrfs/transaction.c:2410 > [<ffffffff8205a516>] btrfs_commit_super+0x86/0xb0 fs/btrfs/disk-io.c:4195 > [<ffffffff8205c743>] close_ctree+0x543/0x730 fs/btrfs/disk-io.c:4349 > [<ffffffff8166b44e>] generic_shutdown_super+0x9e/0x1c0 fs/super.c:499 > [<ffffffff8166b769>] kill_anon_super+0x19/0x30 fs/super.c:1110 > [<ffffffff8202357d>] btrfs_kill_super+0x1d/0x30 fs/btrfs/super.c:2138 > [<ffffffff8166ca46>] deactivate_locked_super+0x46/0xd0 fs/super.c:330 > [<ffffffff8166cb6c>] deactivate_super fs/super.c:361 [inline] > [<ffffffff8166cb6c>] deactivate_super+0x9c/0xb0 fs/super.c:357 > [<ffffffff816a8931>] cleanup_mnt+0x121/0x210 fs/namespace.c:1254 > [<ffffffff812becaf>] task_work_run+0x8f/0xe0 kernel/task_work.c:179 > > > > --- > 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@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the bug is already fixed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want syzbot to run the reproducer, reply with: > #syz test: git://repo/address.git branch-or-commit-hash > If you attach or paste a git patch, syzbot will apply it before testing. > > If you want to change bug's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the bug is a duplicate of another bug, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup > [-- Attachment #2: btrfs.diff --] [-- Type: text/x-patch, Size: 1158 bytes --] diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c index 95d28497de7c..50b59b3dc474 100644 --- a/fs/btrfs/ref-verify.c +++ b/fs/btrfs/ref-verify.c @@ -791,6 +791,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } else if (be->num_refs == 0) { btrfs_err(fs_info, @@ -800,6 +801,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } @@ -822,6 +824,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } exist->num_refs--; @@ -838,6 +841,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } kfree(ref); @@ -849,6 +853,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, dump_ref_action(fs_info, ra); kfree(ref); kfree(ra); + kfree(re); goto out_unlock; } } ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-11-12 13:08 ` Bragatheswaran Manickavel @ 2023-11-12 13:45 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 13:45 UTC (permalink / raw) To: bragathemanick0908, clm, dsterba, josef, linux-btrfs, linux-fsdevel, linux-kernel, syzkaller-bugs Hello, syzbot has tested the proposed patch and the reproducer did not trigger any issue: Reported-and-tested-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com Tested on: commit: 25aa0beb Merge tag 'net-6.5-rc6' of git://git.kernel.o.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git console output: https://syzkaller.appspot.com/x/log.txt?x=17c578a8e80000 kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=16ce93e0e80000 Note: testing is done by a robot and is best-effort only. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot ` (4 preceding siblings ...) 2023-11-12 13:08 ` Bragatheswaran Manickavel @ 2023-11-13 9:44 ` syzbot 2023-11-16 9:42 ` [syzbot] Re: [syzbot] [btrfs?] " syzbot 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-13 9:44 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: memory leak in btrfs_ref_tree_mod Author: jose.pekkarinen@foxhound.fi #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5a6a09e97199d6600d31383055f9d43fbbcbe86f José Pekkarinen. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [syzbot] Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod 2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot ` (5 preceding siblings ...) 2023-11-13 9:44 ` [syzbot] " syzbot @ 2023-11-16 9:42 ` syzbot 6 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-16 9:42 UTC (permalink / raw) To: linux-kernel For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod Author: bragathemanick0908@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 25aa0bebba72b318e71fe205bfd1236550cc9534 On 15/08/23 14:45, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: 25aa0bebba72 Merge tag 'net-6.5-rc6' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=169577fda80000 > kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 > dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f > compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148191c3a80000 > > Downloadable assets: > disk image: https://storage.googleapis.com/syzbot-assets/76b0857d2814/disk-25aa0beb.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/a01574755257/vmlinux-25aa0beb.xz > kernel image: https://storage.googleapis.com/syzbot-assets/262002db770e/bzImage-25aa0beb.xz > mounted in repro: https://storage.googleapis.com/syzbot-assets/b93cffaa6717/mount_0.gz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+d66de4cbf532749df35f@syzkaller.appspotmail.com > > BUG: memory leak > unreferenced object 0xffff888129851240 (size 64): > comm "syz-executor.0", pid 5069, jiffies 4294977377 (age 16.480s) > hex dump (first 32 bytes): > 01 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 00 ................ > backtrace: > [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 > [<ffffffff821731b1>] kmalloc include/linux/slab.h:582 [inline] > [<ffffffff821731b1>] btrfs_ref_tree_mod+0x211/0xb80 fs/btrfs/ref-verify.c:768 > [<ffffffff820444f6>] btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250 > [<ffffffff8202d775>] __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601 > [<ffffffff8202dc54>] btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712 > [<ffffffff8206013c>] commit_cowonly_roots+0x8c/0x3f0 fs/btrfs/transaction.c:1276 > [<ffffffff820647c9>] btrfs_commit_transaction+0x999/0x15c0 fs/btrfs/transaction.c:2410 > [<ffffffff8205a516>] btrfs_commit_super+0x86/0xb0 fs/btrfs/disk-io.c:4195 > [<ffffffff8205c743>] close_ctree+0x543/0x730 fs/btrfs/disk-io.c:4349 > [<ffffffff8166b44e>] generic_shutdown_super+0x9e/0x1c0 fs/super.c:499 > [<ffffffff8166b769>] kill_anon_super+0x19/0x30 fs/super.c:1110 > [<ffffffff8202357d>] btrfs_kill_super+0x1d/0x30 fs/btrfs/super.c:2138 > [<ffffffff8166ca46>] deactivate_locked_super+0x46/0xd0 fs/super.c:330 > [<ffffffff8166cb6c>] deactivate_super fs/super.c:361 [inline] > [<ffffffff8166cb6c>] deactivate_super+0x9c/0xb0 fs/super.c:357 > [<ffffffff816a8931>] cleanup_mnt+0x121/0x210 fs/namespace.c:1254 > [<ffffffff812becaf>] task_work_run+0x8f/0xe0 kernel/task_work.c:179 > > > > --- > 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@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the bug is already fixed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want syzbot to run the reproducer, reply with: > #syz test: git://repo/address.git branch-or-commit-hash > If you attach or paste a git patch, syzbot will apply it before testing. > > If you want to change bug's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the bug is a duplicate of another bug, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup > ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <077cd80b-022f-4401-a32a-33c452bd0179@gmail.com>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <077cd80b-022f-4401-a32a-33c452bd0179@gmail.com> @ 2023-11-12 9:23 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 9:23 UTC (permalink / raw) To: bragathemanick0908, linux-kernel, syzkaller-bugs Hello, syzbot tried to test the proposed patch but the build/boot failed: failed to apply patch: checking file fs/btrfs/ref-verify.c Hunk #1 FAILED at 791. Hunk #2 FAILED at 800. 2 out of 2 hunks FAILED Tested on: commit: 1b907d05 Merge tag '6.7-rc-smb3-client-fixes-part2' of.. git tree: upstream kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: patch: https://syzkaller.appspot.com/x/patch.diff?x=16845fe0e80000 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <143960be-a7d7-44fc-a69f-60e1d12eacdb@gmail.com>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <143960be-a7d7-44fc-a69f-60e1d12eacdb@gmail.com> @ 2023-11-12 9:58 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 9:58 UTC (permalink / raw) To: bragathemanick0908, linux-kernel, syzkaller-bugs Hello, syzbot tried to test the proposed patch but the build/boot failed: failed to apply patch: checking file fs/btrfs/ref-verify.c Hunk #1 FAILED at 791. Hunk #2 FAILED at 800. 2 out of 2 hunks FAILED Tested on: commit: 1b907d05 Merge tag '6.7-rc-smb3-client-fixes-part2' of.. git tree: upstream kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: patch: https://syzkaller.appspot.com/x/patch.diff?x=1652c75b680000 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <441aa0e4-b676-4d0a-a35e-c2f7a912f987@gmail.com>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <441aa0e4-b676-4d0a-a35e-c2f7a912f987@gmail.com> @ 2023-11-12 10:31 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 10:31 UTC (permalink / raw) To: bragathemanick0908, linux-kernel, syzkaller-bugs Hello, syzbot tried to test the proposed patch but the build/boot failed: failed to apply patch: checking file fs/btrfs/ref-verify.c Hunk #1 FAILED at 791. patch: **** malformed patch at line 18: @@ -822,6 +824,7 @@ int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, Tested on: commit: 1b907d05 Merge tag '6.7-rc-smb3-client-fixes-part2' of.. git tree: upstream kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: patch: https://syzkaller.appspot.com/x/patch.diff?x=15e11eff680000 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <7f87b3b9-6876-40d7-b159-94f2119851f9@gmail.com>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <7f87b3b9-6876-40d7-b159-94f2119851f9@gmail.com> @ 2023-11-12 11:52 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-12 11:52 UTC (permalink / raw) To: bragathemanick0908, linux-kernel, syzkaller-bugs Hello, syzbot has tested the proposed patch but the reproducer is still triggering an issue: BUG: corrupted list in btrfs_ref_tree_mod list_add corruption. prev->next should be next (ffff888122a51108), but was 0000000000058000. (prev=ffff88810e236d50). ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:30! invalid opcode: 0000 [#1] PREEMPT SMP CPU: 0 PID: 45 Comm: kworker/u4:2 Not tainted 6.5.0-rc5-syzkaller-00182-g25aa0bebba72-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Workqueue: btrfs-qgroup-rescan btrfs_work_helper RIP: 0010:__list_add_valid+0x74/0x90 lib/list_debug.c:30 Code: e2 fe 0f 0b 48 89 c1 48 c7 c7 68 ff af 85 e8 a3 d7 e2 fe 0f 0b 48 89 d1 48 89 c6 4c 89 c2 48 c7 c7 c0 ff af 85 e8 8c d7 e2 fe <0f> 0b 48 89 f2 48 89 c1 48 89 fe 48 c7 c7 18 00 b0 85 e8 75 d7 e2 RSP: 0018:ffffc900001cf920 EFLAGS: 00010246 RAX: 0000000000000075 RBX: ffff88810e236d50 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8131cbd0 RDI: 0000000000000001 RBP: ffff888122a51108 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 205d353454202020 R12: 0000000000000000 R13: ffff888122aec700 R14: ffff888122aec750 R15: ffff888122a510c0 FS: 0000000000000000(0000) GS:ffff88813bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fd2648f75e8 CR3: 000000010a57a000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> __list_add include/linux/list.h:69 [inline] list_add_tail include/linux/list.h:102 [inline] btrfs_ref_tree_mod+0x454/0xbb0 fs/btrfs/ref-verify.c:887 btrfs_free_tree_block+0x116/0x450 fs/btrfs/extent-tree.c:3250 __btrfs_cow_block+0x6a5/0xa30 fs/btrfs/ctree.c:601 btrfs_cow_block+0x154/0x2b0 fs/btrfs/ctree.c:712 btrfs_search_slot+0xa49/0x1770 fs/btrfs/ctree.c:2194 btrfs_update_root+0x6f/0x500 fs/btrfs/root-tree.c:137 commit_fs_roots+0x236/0x360 fs/btrfs/transaction.c:1450 btrfs_commit_transaction+0x93e/0x15c0 fs/btrfs/transaction.c:2393 btrfs_qgroup_rescan_worker+0x389/0x610 fs/btrfs/qgroup.c:3417 btrfs_work_helper+0x158/0x540 fs/btrfs/async-thread.c:314 process_one_work+0x2f1/0x640 kernel/workqueue.c:2600 worker_thread+0x5c/0x5c0 kernel/workqueue.c:2751 kthread+0x12b/0x170 kernel/kthread.c:389 ret_from_fork+0x2c/0x40 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 </TASK> Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:__list_add_valid+0x74/0x90 lib/list_debug.c:30 Code: e2 fe 0f 0b 48 89 c1 48 c7 c7 68 ff af 85 e8 a3 d7 e2 fe 0f 0b 48 89 d1 48 89 c6 4c 89 c2 48 c7 c7 c0 ff af 85 e8 8c d7 e2 fe <0f> 0b 48 89 f2 48 89 c1 48 89 fe 48 c7 c7 18 00 b0 85 e8 75 d7 e2 RSP: 0018:ffffc900001cf920 EFLAGS: 00010246 RAX: 0000000000000075 RBX: ffff88810e236d50 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8131cbd0 RDI: 0000000000000001 RBP: ffff888122a51108 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 205d353454202020 R12: 0000000000000000 R13: ffff888122aec700 R14: ffff888122aec750 R15: ffff888122a510c0 FS: 0000000000000000(0000) GS:ffff88813bc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fd2648f75e8 CR3: 000000010a57a000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Tested on: commit: 25aa0beb Merge tag 'net-6.5-rc6' of git://git.kernel.o.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git console output: https://syzkaller.appspot.com/x/log.txt?x=10deb938e80000 kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=16a72ca7680000 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <739186bcb83d46101812b06d7e9abb80@foxhound.fi>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <739186bcb83d46101812b06d7e9abb80@foxhound.fi> @ 2023-11-13 12:28 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-13 12:28 UTC (permalink / raw) To: jose.pekkarinen, linux-kernel, syzkaller-bugs Hello, syzbot has tested the proposed patch but the reproducer is still triggering an issue: memory leak in add_block_entry BUG: memory leak unreferenced object 0xffff888122f9fe40 (size 64): comm "syz-executor.1", pid 5844, jiffies 4294945528 (age 11.970s) hex dump (first 32 bytes): 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff81578015>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1098 [<ffffffff821ae165>] kmalloc include/linux/slab.h:600 [inline] [<ffffffff821ae165>] kzalloc include/linux/slab.h:721 [inline] [<ffffffff821ae165>] add_block_entry+0x35/0x320 fs/btrfs/ref-verify.c:270 [<ffffffff821ae806>] add_tree_block+0x96/0x240 fs/btrfs/ref-verify.c:332 [<ffffffff821afdf6>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821afdf6>] process_leaf fs/btrfs/ref-verify.c:524 [inline] [<ffffffff821afdf6>] walk_down_tree fs/btrfs/ref-verify.c:576 [inline] [<ffffffff821afdf6>] btrfs_build_ref_tree+0x566/0x8c0 fs/btrfs/ref-verify.c:1013 [<ffffffff82095365>] open_ctree+0x18c5/0x2370 fs/btrfs/disk-io.c:3523 [<ffffffff8205ab21>] btrfs_fill_super fs/btrfs/super.c:1117 [inline] [<ffffffff8205ab21>] btrfs_mount_root+0x5a1/0x750 fs/btrfs/super.c:1478 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d06db>] fc_mount fs/namespace.c:1114 [inline] [<ffffffff816d06db>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1144 [<ffffffff816d075f>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1131 [<ffffffff8205eb82>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1538 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d882f>] do_new_mount fs/namespace.c:3337 [inline] [<ffffffff816d882f>] path_mount+0xc8f/0x10d0 fs/namespace.c:3664 [<ffffffff816d9421>] do_mount fs/namespace.c:3677 [inline] [<ffffffff816d9421>] __do_sys_mount fs/namespace.c:3886 [inline] [<ffffffff816d9421>] __se_sys_mount fs/namespace.c:3863 [inline] [<ffffffff816d9421>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3863 [<ffffffff84b4945f>] do_syscall_x64 arch/x86/entry/common.c:51 [inline] [<ffffffff84b4945f>] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 BUG: memory leak unreferenced object 0xffff8881216a7ba0 (size 96): comm "syz-executor.1", pid 5844, jiffies 4294945528 (age 11.970s) hex dump (first 32 bytes): 00 10 10 00 00 00 00 00 00 10 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 ................ backtrace: [<ffffffff81578015>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1098 [<ffffffff821ae17e>] kmalloc include/linux/slab.h:600 [inline] [<ffffffff821ae17e>] kzalloc include/linux/slab.h:721 [inline] [<ffffffff821ae17e>] add_block_entry+0x4e/0x320 fs/btrfs/ref-verify.c:271 [<ffffffff821ae806>] add_tree_block+0x96/0x240 fs/btrfs/ref-verify.c:332 [<ffffffff821afdf6>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821afdf6>] process_leaf fs/btrfs/ref-verify.c:524 [inline] [<ffffffff821afdf6>] walk_down_tree fs/btrfs/ref-verify.c:576 [inline] [<ffffffff821afdf6>] btrfs_build_ref_tree+0x566/0x8c0 fs/btrfs/ref-verify.c:1013 [<ffffffff82095365>] open_ctree+0x18c5/0x2370 fs/btrfs/disk-io.c:3523 [<ffffffff8205ab21>] btrfs_fill_super fs/btrfs/super.c:1117 [inline] [<ffffffff8205ab21>] btrfs_mount_root+0x5a1/0x750 fs/btrfs/super.c:1478 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d06db>] fc_mount fs/namespace.c:1114 [inline] [<ffffffff816d06db>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1144 [<ffffffff816d075f>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1131 [<ffffffff8205eb82>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1538 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d882f>] do_new_mount fs/namespace.c:3337 [inline] [<ffffffff816d882f>] path_mount+0xc8f/0x10d0 fs/namespace.c:3664 [<ffffffff816d9421>] do_mount fs/namespace.c:3677 [inline] [<ffffffff816d9421>] __do_sys_mount fs/namespace.c:3886 [inline] [<ffffffff816d9421>] __se_sys_mount fs/namespace.c:3863 [inline] [<ffffffff816d9421>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3863 [<ffffffff84b4945f>] do_syscall_x64 arch/x86/entry/common.c:51 [inline] [<ffffffff84b4945f>] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 BUG: memory leak unreferenced object 0xffff888122f9fec0 (size 64): comm "syz-executor.1", pid 5844, jiffies 4294945528 (age 11.970s) hex dump (first 32 bytes): 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff81578015>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1098 [<ffffffff821ae165>] kmalloc include/linux/slab.h:600 [inline] [<ffffffff821ae165>] kzalloc include/linux/slab.h:721 [inline] [<ffffffff821ae165>] add_block_entry+0x35/0x320 fs/btrfs/ref-verify.c:270 [<ffffffff821ae806>] add_tree_block+0x96/0x240 fs/btrfs/ref-verify.c:332 [<ffffffff821afdf6>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821afdf6>] process_leaf fs/btrfs/ref-verify.c:524 [inline] [<ffffffff821afdf6>] walk_down_tree fs/btrfs/ref-verify.c:576 [inline] [<ffffffff821afdf6>] btrfs_build_ref_tree+0x566/0x8c0 fs/btrfs/ref-verify.c:1013 [<ffffffff82095365>] open_ctree+0x18c5/0x2370 fs/btrfs/disk-io.c:3523 [<ffffffff8205ab21>] btrfs_fill_super fs/btrfs/super.c:1117 [inline] [<ffffffff8205ab21>] btrfs_mount_root+0x5a1/0x750 fs/btrfs/super.c:1478 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d06db>] fc_mount fs/namespace.c:1114 [inline] [<ffffffff816d06db>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1144 [<ffffffff816d075f>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1131 [<ffffffff8205eb82>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1538 [<ffffffff816fd5a9>] legacy_get_tree+0x29/0x80 fs/fs_context.c:662 [<ffffffff81692d2a>] vfs_get_tree+0x2a/0x130 fs/super.c:1768 [<ffffffff816d882f>] do_new_mount fs/namespace.c:3337 [inline] [<ffffffff816d882f>] path_mount+0xc8f/0x10d0 fs/namespace.c:3664 [<ffffffff816d9421>] do_mount fs/namespace.c:3677 [inline] [<ffffffff816d9421>] __do_sys_mount fs/namespace.c:3886 [inline] [<ffffffff816d9421>] __se_sys_mount fs/namespace.c:3863 [inline] [<ffffffff816d9421>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3863 [<ffffffff84b4945f>] do_syscall_x64 arch/x86/entry/common.c:51 [inline] [<ffffffff84b4945f>] do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82 Tested on: commit: 5a6a09e9 Merge tag 'cgroup-for-6.7' of git://git.kerne.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git console output: https://syzkaller.appspot.com/x/log.txt?x=12ab8f5b680000 kernel config: https://syzkaller.appspot.com/x/.config?x=492c9379bc08e464 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=17406848e80000 ^ permalink raw reply [flat|nested] 15+ messages in thread
[parent not found: <ceaf0f0d-d943-4c1a-a531-5193ea64dd29@gmail.com>]
* Re: [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod [not found] <ceaf0f0d-d943-4c1a-a531-5193ea64dd29@gmail.com> @ 2023-11-16 10:22 ` syzbot 0 siblings, 0 replies; 15+ messages in thread From: syzbot @ 2023-11-16 10:22 UTC (permalink / raw) To: bragathemanick0908, linux-kernel, syzkaller-bugs Hello, syzbot has tested the proposed patch but the reproducer is still triggering an issue: memory leak in add_tree_block BUG: memory leak unreferenced object 0xffff88812611f380 (size 64): comm "syz-executor.5", pid 7474, jiffies 4294960257 (age 171.960s) hex dump (first 32 bytes): 03 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 00 ................ backtrace: [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 [<ffffffff82172d99>] kmalloc include/linux/slab.h:582 [inline] [<ffffffff82172d99>] add_tree_block+0x39/0x240 fs/btrfs/ref-verify.c:319 [<ffffffff821743f9>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821743f9>] process_leaf fs/btrfs/ref-verify.c:521 [inline] [<ffffffff821743f9>] walk_down_tree fs/btrfs/ref-verify.c:573 [inline] [<ffffffff821743f9>] btrfs_build_ref_tree+0x589/0x850 fs/btrfs/ref-verify.c:1008 [<ffffffff8205ec90>] open_ctree+0x1890/0x2270 fs/btrfs/disk-io.c:3471 [<ffffffff8202582f>] btrfs_fill_super fs/btrfs/super.c:1154 [inline] [<ffffffff8202582f>] btrfs_mount_root+0x5af/0x750 fs/btrfs/super.c:1519 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816a776b>] fc_mount fs/namespace.c:1112 [inline] [<ffffffff816a776b>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1142 [<ffffffff816a77ef>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1129 [<ffffffff820298b2>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1579 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816afcff>] do_new_mount fs/namespace.c:3335 [inline] [<ffffffff816afcff>] path_mount+0xc8f/0x10d0 fs/namespace.c:3662 [<ffffffff816b08f1>] do_mount fs/namespace.c:3675 [inline] [<ffffffff816b08f1>] __do_sys_mount fs/namespace.c:3884 [inline] [<ffffffff816b08f1>] __se_sys_mount fs/namespace.c:3861 [inline] [<ffffffff816b08f1>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3861 [<ffffffff84ad2bb8>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<ffffffff84ad2bb8>] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 [<ffffffff84c0008b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd BUG: memory leak unreferenced object 0xffff88812611f500 (size 64): comm "syz-executor.5", pid 7474, jiffies 4294960257 (age 171.960s) hex dump (first 32 bytes): 03 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 [<ffffffff82172755>] kmalloc include/linux/slab.h:582 [inline] [<ffffffff82172755>] kzalloc include/linux/slab.h:703 [inline] [<ffffffff82172755>] add_block_entry+0x35/0x320 fs/btrfs/ref-verify.c:270 [<ffffffff82172df6>] add_tree_block+0x96/0x240 fs/btrfs/ref-verify.c:332 [<ffffffff821743f9>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821743f9>] process_leaf fs/btrfs/ref-verify.c:521 [inline] [<ffffffff821743f9>] walk_down_tree fs/btrfs/ref-verify.c:573 [inline] [<ffffffff821743f9>] btrfs_build_ref_tree+0x589/0x850 fs/btrfs/ref-verify.c:1008 [<ffffffff8205ec90>] open_ctree+0x1890/0x2270 fs/btrfs/disk-io.c:3471 [<ffffffff8202582f>] btrfs_fill_super fs/btrfs/super.c:1154 [inline] [<ffffffff8202582f>] btrfs_mount_root+0x5af/0x750 fs/btrfs/super.c:1519 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816a776b>] fc_mount fs/namespace.c:1112 [inline] [<ffffffff816a776b>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1142 [<ffffffff816a77ef>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1129 [<ffffffff820298b2>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1579 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816afcff>] do_new_mount fs/namespace.c:3335 [inline] [<ffffffff816afcff>] path_mount+0xc8f/0x10d0 fs/namespace.c:3662 [<ffffffff816b08f1>] do_mount fs/namespace.c:3675 [inline] [<ffffffff816b08f1>] __do_sys_mount fs/namespace.c:3884 [inline] [<ffffffff816b08f1>] __se_sys_mount fs/namespace.c:3861 [inline] [<ffffffff816b08f1>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3861 [<ffffffff84ad2bb8>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<ffffffff84ad2bb8>] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 BUG: memory leak unreferenced object 0xffff8881260d4300 (size 96): comm "syz-executor.5", pid 7474, jiffies 4294960257 (age 171.960s) hex dump (first 32 bytes): 00 10 10 00 00 00 00 00 00 10 00 00 00 00 00 00 ................ 01 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 ................ backtrace: [<ffffffff815545e5>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1076 [<ffffffff8217276e>] kmalloc include/linux/slab.h:582 [inline] [<ffffffff8217276e>] kzalloc include/linux/slab.h:703 [inline] [<ffffffff8217276e>] add_block_entry+0x4e/0x320 fs/btrfs/ref-verify.c:271 [<ffffffff82172df6>] add_tree_block+0x96/0x240 fs/btrfs/ref-verify.c:332 [<ffffffff821743f9>] process_extent_item fs/btrfs/ref-verify.c:474 [inline] [<ffffffff821743f9>] process_leaf fs/btrfs/ref-verify.c:521 [inline] [<ffffffff821743f9>] walk_down_tree fs/btrfs/ref-verify.c:573 [inline] [<ffffffff821743f9>] btrfs_build_ref_tree+0x589/0x850 fs/btrfs/ref-verify.c:1008 [<ffffffff8205ec90>] open_ctree+0x1890/0x2270 fs/btrfs/disk-io.c:3471 [<ffffffff8202582f>] btrfs_fill_super fs/btrfs/super.c:1154 [inline] [<ffffffff8202582f>] btrfs_mount_root+0x5af/0x750 fs/btrfs/super.c:1519 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816a776b>] fc_mount fs/namespace.c:1112 [inline] [<ffffffff816a776b>] vfs_kern_mount.part.0+0xcb/0x110 fs/namespace.c:1142 [<ffffffff816a77ef>] vfs_kern_mount+0x3f/0x60 fs/namespace.c:1129 [<ffffffff820298b2>] btrfs_mount+0x1e2/0x660 fs/btrfs/super.c:1579 [<ffffffff816d3e39>] legacy_get_tree+0x29/0x80 fs/fs_context.c:611 [<ffffffff8166b7ea>] vfs_get_tree+0x2a/0x110 fs/super.c:1519 [<ffffffff816afcff>] do_new_mount fs/namespace.c:3335 [inline] [<ffffffff816afcff>] path_mount+0xc8f/0x10d0 fs/namespace.c:3662 [<ffffffff816b08f1>] do_mount fs/namespace.c:3675 [inline] [<ffffffff816b08f1>] __do_sys_mount fs/namespace.c:3884 [inline] [<ffffffff816b08f1>] __se_sys_mount fs/namespace.c:3861 [inline] [<ffffffff816b08f1>] __x64_sys_mount+0x1a1/0x1f0 fs/namespace.c:3861 [<ffffffff84ad2bb8>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<ffffffff84ad2bb8>] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 Tested on: commit: 25aa0beb Merge tag 'net-6.5-rc6' of git://git.kernel.o.. git tree: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git console output: https://syzkaller.appspot.com/x/log.txt?x=11a0c5b7680000 kernel config: https://syzkaller.appspot.com/x/.config?x=2bf8962e4f7984f4 dashboard link: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=1799b938e80000 ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2023-11-16 10:22 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 9:15 [syzbot] [btrfs?] memory leak in btrfs_ref_tree_mod syzbot
2023-11-12 9:17 ` [syzbot] " syzbot
2023-11-12 9:33 ` syzbot
2023-11-12 10:16 ` syzbot
2023-11-12 11:04 ` syzbot
2023-11-12 13:08 ` Bragatheswaran Manickavel
2023-11-12 13:45 ` syzbot
2023-11-13 9:44 ` [syzbot] " syzbot
2023-11-16 9:42 ` [syzbot] Re: [syzbot] [btrfs?] " syzbot
[not found] <077cd80b-022f-4401-a32a-33c452bd0179@gmail.com>
2023-11-12 9:23 ` syzbot
[not found] <143960be-a7d7-44fc-a69f-60e1d12eacdb@gmail.com>
2023-11-12 9:58 ` syzbot
[not found] <441aa0e4-b676-4d0a-a35e-c2f7a912f987@gmail.com>
2023-11-12 10:31 ` syzbot
[not found] <7f87b3b9-6876-40d7-b159-94f2119851f9@gmail.com>
2023-11-12 11:52 ` syzbot
[not found] <739186bcb83d46101812b06d7e9abb80@foxhound.fi>
2023-11-13 12:28 ` syzbot
[not found] <ceaf0f0d-d943-4c1a-a531-5193ea64dd29@gmail.com>
2023-11-16 10:22 ` syzbot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.