From nobody Thu Dec 18 08:35:41 2025 Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9AC21329C43 for ; Tue, 9 Dec 2025 16:53:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.71 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765299190; cv=none; b=E/g+voOsY9FXLL7ZWfi4VlXRIHv8EH+bIr76GBe/ziGRQnjbYuDFq9CCTC7ony8gY4xjAkSmhKod2pjsf478vkaqafttcVSr2TjekG97npmIQD7W/GIWCMpYz9cVL05ez+xb+gij9kmg1e5LsWWYfRl4oTZ5fP+FZmGZaNtzx24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765299190; c=relaxed/simple; bh=Xnj02M4v4vZ5XMOeHYLceJSjFfUvP1il83MZYhKjm2c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=OGTuTge+CEhwcfhd5eVs7BkMx7Vjj1jL3Hoih7PcOBINAB81/KcQxphqZ21eAYutOXSWjf7huJZ0qkX/DfHN8SSj7T/cr7RxgxxjYy1p7Jk2BZK0s5hqGGmc/kL/Ch1JRbIsKXzlbbW6yfg0auDoofk2oa/+wT5G4ry8BBNDyW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f71.google.com with SMTP id 006d021491bc7-6576fd62dffso7252865eaf.2 for ; Tue, 09 Dec 2025 08:53:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765299185; x=1765903985; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U8LmLsgbKqyOYC6+iW9y1nYfydo7JCV1aNQDfjHWyW4=; b=cbYs2NV8MxhV48sHTOEy4Y02BZJJQuhg2JpCPgO/8PzU6ohRQZGa00Wr79ooOpX1oN beJ+fA59BmWRfJT1mBUR/iMOklvSzoABjOPgywoZG82Wde6kiJFgWyPe5AeMxoF3VGVi CWv2H78+bhBVYUUUNhcKthFALFKMLYd9eWmhgYzEhXAGD5nMCUXkT2ypJiOVNM8uaQ6D Tb94YMAZC5ejAhnbacvBwRnLW0+9HeLRNzciF2am5GywYfy1O5h5SCITwVQrwTGkFY/J l+sigAo7scWVLGO2e5LU9DcGJGtzqu91/8zp1jilPC+QVXCxH5aYpdySENnpdrOami/U 99qQ== X-Gm-Message-State: AOJu0YwbQSSeyTZC0yTyzT2zEL1vaXaiRSuHo7DCSQgLCqyxV+J12QZH ilfoLwOoK6FsbLS1NL2J3WOFOKFgU++/QedNchXYWbAQmRcl63Qyo2WBTDmtekCIUYNcpuKa95A Rjtm7HwApHJcPWHWyqArjrh6dyWeQ0bKiqVfaGNqNDokWnwnt7xlerDEChVM= X-Google-Smtp-Source: AGHT+IFUfoO6mE6ZkCiDy3BVoledLSHIrm9voNPOUcOSU+xa/YMqkavudw6Pu5FKWHuZVCeoAqleIDH5pS3jlBHUQm6Qu3CjImXv Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:2289:b0:659:9a49:8f67 with SMTP id 006d021491bc7-6599a9608famr5129917eaf.44.1765299185356; Tue, 09 Dec 2025 08:53:05 -0800 (PST) Date: Tue, 09 Dec 2025 08:53:05 -0800 In-Reply-To: <69369331.a70a0220.38f243.009e.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <693853f1.a70a0220.104cf0.000a.GAE@google.com> Subject: Forwarded: [PATCH] memory leak in btrfs_read_chunk_tree From: syzbot To: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org. *** Subject: [PATCH] memory leak in btrfs_read_chunk_tree Author: hariconscious@gmail.com #syz test diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ae1742a35e76..b416f7d642bb 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -7188,6 +7188,8 @@ static int read_one_dev(struct extent_buffer *leaf, if (!btrfs_test_opt(fs_info, DEGRADED)) { btrfs_report_missing_device(fs_info, devid, dev_uuid, true); + //1 + free_fs_devices(fs_devices); return -ENOENT; } @@ -7196,6 +7198,8 @@ static int read_one_dev(struct extent_buffer *leaf, btrfs_err(fs_info, "failed to add missing dev %llu: %ld", devid, PTR_ERR(device)); + //2 + free_fs_devices(fs_devices); return PTR_ERR(device); } btrfs_report_missing_device(fs_info, devid, dev_uuid, false= ); @@ -7204,6 +7208,8 @@ static int read_one_dev(struct extent_buffer *leaf, if (!btrfs_test_opt(fs_info, DEGRADED)) { btrfs_report_missing_device(fs_info, devid, dev_uuid, true); + //3 + free_fs_devices(fs_devices); return -ENOENT; } btrfs_report_missing_device(fs_info, devid, @@ -7242,6 +7248,9 @@ static int read_one_dev(struct extent_buffer *leaf, BUG_ON(test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_sta= te)); if (device->generation !=3D btrfs_device_generation(leaf, dev_item)) + //4 + free_fs_devices(fs_devices); + btrfs_free_device(device); return -EINVAL; } @@ -7253,6 +7262,9 @@ static int read_one_dev(struct extent_buffer *leaf, btrfs_err(fs_info, "device total_bytes should be at most %llu but found %llu", max_total_bytes, device->total_bytes); + //5 + free_fs_devices(fs_devices); + btrfs_free_device(device); return -EINVAL; } }