Menu

Star on GitHub · 3.2k

CVE-2021-47118

7.8 · HIGH

In the Linux kernel, the following vulnerability has been resolved: pid: take a reference when initializing `cad_pid` During boot, kernel_init_freeable() initializes `cad_pid` to the init task's…

Published Mar 15, 2024CWE-416EPSS 0.25%

Overview

CVE-2021-47118 is a high-severity vulnerability. It was published on March 15, 2024 and has a CVSS 3.1 base score of 7.8 (HIGH).

This vulnerability has a CVSS 3.1 base score of 7.8, rated HIGH. 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:

pid: take a reference when initializing `cad_pid`

During boot, kernel_init_freeable() initializes `cad_pid` to the init

task's struct pid. Later on, we may change `cad_pid` via a sysctl, and

when this happens proc_do_cad_pid() will increment the refcount on the

new pid via get_pid(), and will decrement the refcount on the old pid

via put_pid(). As we never called get_pid() when we initialized

`cad_pid`, we decrement a reference we never incremented, can therefore

free the init task's struct pid early. As there can be dangling

references to the struct pid, we can later encounter a use-after-free

(e.g. when delivering signals).

This was spotted when fuzzing v5.13-rc3 with Syzkaller, but seems to

have been around since the conversion of `cad_pid` to struct pid in

commit 9ec52099e4b8 ("[PATCH] replace cad_pid by a struct pid") from the

pre-KASAN stone age of v2.6.19.

Fix this by getting a reference to the init task

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-47118?

CVE-2021-47118 is a high-severity vulnerability. It was published on March 15, 2024 and has a CVSS 3.1 base score of 7.8 (HIGH).

How severe is CVE-2021-47118?

This vulnerability has a CVSS 3.1 base score of 7.8, rated HIGH. 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-47118?

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-47118?

CyberStrike is an open-source, AI-augmented pentesting engine. Rather than flag a version number, it tests whether an issue like CVE-2021-47118 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 HIGH CVEs from 2021

View all