CVE-2021-47412: block: don't call rq_qos_ops->done_bio if the bio isn't tracked
In the Linux kernel, the following vulnerability has been resolved:
block: don't call rqqosops->donebio if the bio isn't tracked
rqqos framework is only applied on request based driver, so:
1) rqqosdonebio() needn't to be called for bio based driver
2) rqqosdonebio() needn't to be called for bio which isn't tracked, such as bios ended from error handling code.
Especially in bioendio():
1) request queue is referred via bio->bibdev->bddisk->queue, which may be gone since request queue refcount may not be held in above two cases
2) q->rqqos may be freed in blkcleanupqueue() when calling into rqqosdonebio()
Fix the potential kernel panic by not calling rqqosops->donebio if the bio isn't tracked. This way is safe because both iocrqosdonebio() and blkcgiolatencydonebio() are nop if the bio isn't tracked.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
block: don't call rqqosops->donebio if the bio isn't tracked
The Linux kernel CVE team has assigned CVE-2021-47412 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024052152-CVE-2021-47412-b362@gregkh/T
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.14.11 - Upgrade
Upgrade
redhat/kernelto a version that resolves this vulnerability.Fixed in 5.15 - Compensating control
In the Linux kernel block layer, do not call rq_qos_ops->done_bio (including __rq_qos_done_bio()) for bios that are not tracked, including bios from bio-based drivers and bios ended from error-handling code.
Event History
Frequently Asked Questions
What is the severity of CVE-2021-47412?
CVE-2021-47412 has a medium severity rating due to its potential impact on data processing in specific kernel functions.
How do I fix CVE-2021-47412?
To remediate CVE-2021-47412, update the Linux kernel to version 5.14.11 or later.
What versions of the Linux kernel are affected by CVE-2021-47412?
CVE-2021-47412 affects Linux kernel versions up to 5.14.10 and includes specific release candidates.
Is CVE-2021-47412 a remote exploit vulnerability?
CVE-2021-47412 is not classified as a remote exploit vulnerability but may affect local system operations.
What systems are primarily impacted by CVE-2021-47412?
CVE-2021-47412 primarily impacts systems running vulnerable versions of the Linux kernel on request based drivers.