Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42C61207A0C for ; Wed, 18 Jun 2025 11:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244658; cv=none; b=nySd4IBRJ1N44nGwjH8JIoWmgRCzbmMbC8riTA+NDedU5R5S1ROnAVI4Q3WnkMUaGk3Lkueq8BO842uAvIjKsLsc1/NpWmg/vlA5NOJgUYL2dHolpD5PQFJAK73bha2Lzu5kmFHe3plhamjEW8PXoRilAgkelpCGJUyr9nJ1jAM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244658; c=relaxed/simple; bh=BGj/ZvRExGmCBlSzqYgInY0uc5ygO1bc/ULLnbVrLlg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ERTpItBi5PISem/WpAfv7SfPFL/Vp2mqP51BHqwj4LajyMXHrX0STv1BbK6t+O0hTKVejHMs72COnj/YGPbY98a/kWdGitGkQruysxUzi38zUt4+JOveenCoGYj+/5+AUPQ0vfcl6x71MaNOgu96/cHdOKNeLUChR9isK0TawcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jtHH9j3T; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jtHH9j3T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2DEDC4CEE7; Wed, 18 Jun 2025 11:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244658; bh=BGj/ZvRExGmCBlSzqYgInY0uc5ygO1bc/ULLnbVrLlg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jtHH9j3T7Ei6EByPXRioJoQ3ll9mM7JEjJsa5oXuOU7FyUAoJD8Gyu+8lyXhucwvM Lmao26gvlurC6dfE65EaX+VxDBTAU3D5oUB6/PNXqK69U6iW9UJyGaKI/MDQX4nk5J oz+RgWUrzGk8T10OJDHeqFjWsvrDphxljcf92M20= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49996: btrfs: fix possible memory leak in btrfs_get_dev_args_from_path() Date: Wed, 18 Jun 2025 13:01:01 +0200 Message-ID: <2025061826-CVE-2022-49996-71e2@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2374; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xqTt7oL3UE0cJvzHqwkw8evd8CXAhAIz0kLEs9yRFyM=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc7zcZI69WW3sPqtqT0LQn6O+z82FG/fFlacufHnpl /6PiT/5O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAimhsY5hd9qJz4ruNj6OOD 8XEre44s52XTeM8wTzdLjqNJ61TS/fueDGyG9izS0e3JAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: btrfs: fix possible memory leak in btrfs_get_dev_args_from_path() In btrfs_get_dev_args_from_path(), btrfs_get_bdev_and_sb() can fail if the path is invalid. In this case, btrfs_get_dev_args_from_path() returns directly without freeing args->uuid and args->fsid allocated before, which causes memory leak. To fix these possible leaks, when btrfs_get_bdev_and_sb() fails, btrfs_put_dev_args_from_path() is called to clean up the memory. The Linux kernel CVE team has assigned CVE-2022-49996 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15.54 with commit 321a81835b4aed4f717f89921286f6544ffa8be9 and fixed in 5.15.64 with commit 5f52402c77013e4a826394b807dd5ea4dc83bd72 Issue introduced in 5.16 with commit faa775c41d655a4786e9d53cb075a77bb5a75f66 and fixed in 5.19.6 with commit 4b124ad87244cd7f0883c5eaa38d2326b2154cad Issue introduced in 5.16 with commit faa775c41d655a4786e9d53cb075a77bb5a75f66 and fixed in 6.0 with commit 9ea0106a7a3d8116860712e3f17cd52ce99f6707 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49996 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/btrfs/volumes.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/5f52402c77013e4a826394b807dd5ea4dc83bd72 https://git.kernel.org/stable/c/4b124ad87244cd7f0883c5eaa38d2326b2154cad https://git.kernel.org/stable/c/9ea0106a7a3d8116860712e3f17cd52ce99f6707