Skip to content
Info disclosure Write-up Advanced

CVE-2021-4440: A Linux CNA Case Study

A bad backport of MDS mitigation patches to the 5.10 LTS kernel caused the CLEAR_CPU_BUFFERS macro to be omitted from the 64-bit syscall return path when CONFIG_PARAVIRT_XXL was enabled, turning the MDS mitigation into a no-op. An attacker could then leak kernel data and defeat KASLR.

grsecurity.net

Published on grsecurity.net

This blog serves as a case study into how the newly-formed Linux CNA (CVE Numbering Authority) has affected Linux kernel vulnerability management, through the mishandling of a vulnerability we reported a little over a month ago in the upstream 5.10 LTS kernel.

The author, on grsecurity.net

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the backport of the MDS mitigation patches failed to account for the CONFIG_PARAVIRT_XXL configuration, where USERGS_SYSRET64 is replaced by a paravirt patching call site that does not include the CLEAR_CPU_BUFFERS macro.

Impact

An attacker could leak kernel pointers and data, defeating KASLR, but the text does not specify whether this was demonstrated in practice or limited by other factors.

What the attacker needed

Kernel with CONFIG_PARAVIRT_XXL enabled; affected kernel version (5.10.215+)

The fix

The fix was to drop the USERGS_SYSRET64 paravirt call and explicitly add CLEAR_CPU_BUFFERS to the syscall_return_via_sysret path, as done in kernel 5.10.218.

How it was found

  1. Enable CONFIG_PARAVIRT_XXL (selected by CONFIG_XEN_PV) in the kernel configuration.
  2. Boot the affected kernel (5.10.215 or newer).
  3. Trigger a syscall that returns via the sysret path.
  4. Observe that the VERW instruction is not executed, leaving MDS mitigation disabled.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The kernel has a defence against a type of attack that can leak secret data from the CPU. A patch meant to improve that defence was applied incorrectly to an older kernel version, so the defence was effectively switched off on a common code path. This means an attacker could potentially read sensitive kernel memory and learn where things are stored, weakening a key security protection.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.