syzbot


memory leak in clear_state_bit

Status: upstream: reported C repro on 2023/11/24 04:07
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+81670362c283f3dd889c@syzkaller.appspotmail.com
Fix commit: c346c629765a btrfs: qgroup: don't use extent changeset when not needed
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root 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-386-root ci-upstream-kmsan-gce-root 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-qemu-native-arm64-kvm]
First crash: 330d, last: 315d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] btrfs: qgroup: add missing extent changeset release 9 (9) 2024/08/28 21:56
[syzbot] [btrfs?] memory leak in clear_state_bit 0 (1) 2023/11/24 04:07
Last patch testing requests (10)
Created Duration User Patch Repo Result
2024/07/08 21:51 2h07m retest repro upstream report log
2024/07/08 21:51 33m retest repro upstream report log
2024/07/08 21:51 2h49m retest repro upstream report log
2024/04/26 00:38 22m retest repro upstream report log
2024/04/26 00:38 20m retest repro upstream report log
2024/04/26 00:38 14m retest repro upstream report log
2024/02/13 22:22 15m retest repro upstream report log
2024/02/13 22:22 15m retest repro upstream report log
2024/02/13 22:22 10m retest repro upstream report log
2023/12/05 05:33 17m retest repro upstream report log

Sample crash report:
write to /proc/sys/kernel/softlockup_all_cpu_backtrace failed: No such file or directory
BUG: memory leak
unreferenced object 0xffff888100812800 (size 64):
  comm "syz-executor358", pid 5076, jiffies 4294970941 (age 12.950s)
  hex dump (first 32 bytes):
    00 00 48 00 00 00 00 00 ff ff 48 00 00 00 00 00  ..H.......H.....
    60 b6 52 02 00 c9 ff ff 60 b6 52 02 00 c9 ff ff  `.R.....`.R.....
  backtrace:
    [<ffffffff816339bd>] kmemleak_alloc_recursive include/linux/kmemleak.h:42 [inline]
    [<ffffffff816339bd>] slab_post_alloc_hook mm/slab.h:766 [inline]
    [<ffffffff816339bd>] slab_alloc_node mm/slub.c:3478 [inline]
    [<ffffffff816339bd>] __kmem_cache_alloc_node+0x2dd/0x3f0 mm/slub.c:3517
    [<ffffffff8157e845>] kmalloc_trace+0x25/0x90 mm/slab_common.c:1098
    [<ffffffff8215ec8b>] kmalloc include/linux/slab.h:600 [inline]
    [<ffffffff8215ec8b>] ulist_add_merge fs/btrfs/ulist.c:210 [inline]
    [<ffffffff8215ec8b>] ulist_add_merge+0xcb/0x2b0 fs/btrfs/ulist.c:198
    [<ffffffff821b3964>] add_extent_changeset fs/btrfs/extent-io-tree.c:199 [inline]
    [<ffffffff821b3964>] add_extent_changeset fs/btrfs/extent-io-tree.c:186 [inline]
    [<ffffffff821b3964>] clear_state_bit+0xa4/0x1f0 fs/btrfs/extent-io-tree.c:559
    [<ffffffff821b4b12>] __clear_extent_bit+0x432/0x840 fs/btrfs/extent-io-tree.c:731
    [<ffffffff82169c7d>] __btrfs_qgroup_release_data+0x21d/0x4a0 fs/btrfs/qgroup.c:4123
    [<ffffffff820e2737>] alloc_ordered_extent+0x57/0x2c0 fs/btrfs/ordered-data.c:159
    [<ffffffff820e2dc8>] btrfs_alloc_ordered_extent+0x78/0x4f0 fs/btrfs/ordered-data.c:274
    [<ffffffff820ab67a>] btrfs_create_dio_extent+0xba/0x1b0 fs/btrfs/inode.c:6953
    [<ffffffff820c47ac>] btrfs_get_blocks_direct_write fs/btrfs/inode.c:7343 [inline]
    [<ffffffff820c47ac>] btrfs_dio_iomap_begin+0xcbc/0x11a0 fs/btrfs/inode.c:7594
    [<ffffffff81772039>] iomap_iter+0x219/0x590 fs/iomap/iter.c:91
    [<ffffffff8177968b>] __iomap_dio_rw+0x2bb/0xd40 fs/iomap/direct-io.c:658
    [<ffffffff820c4da3>] btrfs_dio_write+0x73/0xa0 fs/btrfs/inode.c:7798
    [<ffffffff820cf774>] btrfs_direct_write fs/btrfs/file.c:1543 [inline]
    [<ffffffff820cf774>] btrfs_do_write_iter+0x454/0x960 fs/btrfs/file.c:1684
    [<ffffffff816924c4>] call_write_iter include/linux/fs.h:2020 [inline]
    [<ffffffff816924c4>] do_iter_readv_writev+0x154/0x220 fs/read_write.c:735
    [<ffffffff81693c4c>] do_iter_write+0xec/0x370 fs/read_write.c:860

write to /proc/sys/kernel/hung_task_check_interval_secs failed: No such file or directory
write to /proc/sys/kernel/softlockup_all_cpu_backtrace failed: No such file or directory

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/11/21 05:15 upstream 98b1cc82c4af cb976f63 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-leak memory leak in clear_state_bit
2023/11/21 04:05 upstream 98b1cc82c4af cb976f63 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-leak memory leak in clear_state_bit
2023/11/20 03:56 upstream eb3479bc23fa cb976f63 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-leak memory leak in clear_state_bit
* Struck through repros no longer work on HEAD.