Menu

Star on GitHub · 3.2k

CVE-2021-47585

5.5 · MEDIUM

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix memory leak in __add_inode_ref() Line 1169 (#3) allocates a memory chunk for victim_name by kmalloc(), but when the…

Published Jun 19, 2024CWE-401EPSS 0.25%

Overview

CVE-2021-47585 is a medium-severity vulnerability. It was published on June 19, 2024 and has a CVSS 3.1 base score of 5.5 (MEDIUM).

This vulnerability has a CVSS 3.1 base score of 5.5, rated MEDIUM. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

Technical description

In the Linux kernel, the following vulnerability has been resolved:

btrfs: fix memory leak in __add_inode_ref()

Line 1169 (#3) allocates a memory chunk for victim_name by kmalloc(),

but when the function returns in line 1184 (#4) victim_name allocated

by line 1169 (#3) is not freed, which will lead to a memory leak.

There is a similar snippet of code in this function as allocating a memory

chunk for victim_name in line 1104 (#1) as well as releasing the memory

in line 1116 (#2).

We should kfree() victim_name when the return value of backref_in_log()

is less than zero and before the function returns in line 1184 (#4).

1057 static inline int __add_inode_ref(struct btrfs_trans_handle *trans,

1058 struct btrfs_root *root,

1059 struct btrfs_path *path,

1060 struct btrfs_root *log_root,

1061 struct btrfs_inode *dir,

1062 struct btrfs_inode *inode,

1063 u64 inode_objectid, u64 parent_objectid,

1064 u64 ref_index, char *name, int namelen,

1065

Remediation

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Frequently asked questions

What is CVE-2021-47585?

CVE-2021-47585 is a medium-severity vulnerability. It was published on June 19, 2024 and has a CVSS 3.1 base score of 5.5 (MEDIUM).

How severe is CVE-2021-47585?

This vulnerability has a CVSS 3.1 base score of 5.5, rated MEDIUM. It requires local or adjacent network access to exploit. Some level of privileges is required for exploitation.

How do I fix or remediate CVE-2021-47585?

Check the references section for vendor advisories, patches, and mitigation guidance. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2021-47585?

CyberStrike is an open-source, AI-augmented pentesting engine. Rather than flag a version number, it tests whether an issue like CVE-2021-47585 is actually reachable in your own applications and APIs, then verifies each finding before reporting it. That tells you if the weakness is a real, exploitable risk in your environment or a false positive you can safely deprioritize.

Related MEDIUM CVEs from 2021

View all