CVE-2022-49996

btrfs: fix possible memory leak in btrfs_get_dev_args_from_path()

State
Published
Severity
Not scored
Published
Jun 18, 2025
Updated
May 23, 2026
Reserved
Jun 18, 2025

Read the record on cve.org

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.

Scores

The record has no CVSS score.

Weaknesses

The record names no weakness.

Affected Products

ProductVersions
LinuxLinux
  • 321a81835b4aed4f717f89921286f6544ffa8be9 to before 5f52402c77013e4a826394b807dd5ea4dc83bd72Affected
  • faa775c41d655a4786e9d53cb075a77bb5a75f66 to before 4b124ad87244cd7f0883c5eaa38d2326b2154cadAffected
  • faa775c41d655a4786e9d53cb075a77bb5a75f66 to before 9ea0106a7a3d8116860712e3f17cd52ce99f6707Affected
  • 5.15.54 to before 5.15.64Affected
LinuxLinux
  • 5.16Affected
  • before 5.16Not affected
  • 5.15.64 through 5.15.*Not affected
  • 5.19.6 through 5.19.*Not affected
  • 6.0 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.