CVE-2021-47044: sched/fair: Fix shift-out-of-bounds in load_balance()
In the Linux kernel, the following vulnerability has been resolved:
sched/fair: Fix shift-out-of-bounds in load_balance()
Syzbot reported a handful of occurrences where an sd->nr_balance_failed can
grow to much higher values than one would expect.
A successful load_balance() resets it to 0; a failed one increments
it. Once it gets to sd->cache_nice_tries + 3, this *should* trigger an
active balance, which will either set it to sd->cache_nice_tries+1 or reset
it to 0. However, in case the to-be-active-balanced task is not allowed to
run on env->dst_cpu, then the increment is done without any further
modification.
This could then be repeated ad nauseam, and would explain the absurdly high
values reported by syzbot (86, 149). VincentG noted there is value in
letting sd->cache_nice_tries grow, so the shift itself should be
fixed. That means preventing:
"""
If the value of the right operand is negative or is greater than or equal
to the width of the promoted left operand, the behavior is undefined.
"""
Thus we need to cap the shift exponent to
BITS_PER_TYPE(typeof(lefthand)) - 1.
I had a look around for other similar cases via coccinelle:
@expr@
position pos;
expression E1;
expression E2;
@@
(
E1 >> E2@pos
|
E1 >> E2@pos
)
@cst depends on expr@
position pos;
expression expr.E1;
constant cst;
@@
(
E1 >> cst@pos
|
E1 << cst@pos
)
@script:python depends on !cst@
pos << expr.pos;
exp << expr.E2;
@@
# Dirty hack to ignore constexpr
if exp.upper() != exp:
coccilib.report.print_report(pos[0], "Possible UB shift here")
The only other match in kernel/sched is rq_clock_thermal() which employs
sched_thermal_decay_shift, and that exponent is already capped to 10, so
that one is fine.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel scheduler flaw found by syzbot. Under repeated failed load balancing, a counter can grow high enough to trigger undefined shift behavior. The supplied CVSS rates it high because a local, unauthenticated actor could potentially affect confidentiality and availability.
Executive priority
Treat as a high-priority kernel maintenance item, especially on shared Linux infrastructure. There is no provided evidence of active exploitation, so urgency should focus on patch hygiene and exposure reduction rather than emergency incident response.
Technical view
The issue is in sched/fair load_balance(). sd->nr_balance_failed can keep increasing when active balancing cannot place a task on env->dst_cpu. That value can become an unsafe shift exponent, creating undefined behavior. The fix caps the shift exponent to the left-hand type width minus one.
Likely exposure
Exposure is limited to Linux systems running affected kernel versions identified in the source bundle, including listed 5.10, 5.11, 5.12, and 5.13-era entries. Distro backports may change practical exposure, so asset owners should verify exact kernel package status.
Exploitation context
The source bundle does not show CISA KEV listing or active exploitation. CVSS describes local attack vector, low complexity, no privileges, and no user interaction. Public evidence here supports treating it as a local kernel risk, not a confirmed exploited-in-the-wild issue.
Researcher notes
The record maps to a scheduler undefined-behavior fix, despite CWE-125 being listed. The strongest evidence is the upstream stable commit set and CVSS vector. The provided affected-version data is coarse, so distro-specific advisory validation is important.
Mitigation direction
Apply supported Linux vendor or distribution kernel updates containing the stable fix.
Check whether your kernel package backports one of the referenced stable commits.
Prioritize shared, multi-user, container-hosting, and untrusted workload systems.
If backport status is unclear, follow vendor guidance rather than assuming version numbers alone.
Monitor CVE and vendor advisories for updated affected-version mapping.
Validation and detection
Inventory running kernel versions across Linux hosts and images.
Compare distro package changelogs against CVE-2021-47044 and referenced stable commits.
Confirm rebooted hosts are running the updated kernel, not only installed packages.
Check container hosts separately; containers share the host kernel.
Document exceptions where vendor support states the kernel is unaffected or backported.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-125: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-125 · source CWE mapping
Out-of-bounds Read
Out-of-bounds Read represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.