CVE-2022-50170: kunit: executor: Fix a memory leak on failure in kunit_filter_tests
In the Linux kernel, the following vulnerability has been resolved:
kunit: executor: Fix a memory leak on failure in kunit_filter_tests
It's possible that memory allocation for 'filtered' will fail, but for the
copy of the suite to succeed. In this case, the copy could be leaked.
Properly free 'copy' in the error case for the allocation of 'filtered'
failing.
Note that there may also have been a similar issue in
kunit_filter_subsuites, before it was removed in "kunit: flatten
kunit_suite*** to kunit_suite** in .kunit_test_suites".
This was reported by clang-analyzer via the kernel test robot, here:
https://lore.kernel.org/all/c8073b8e-7b9e-0830-4177-87c12f16349c@intel.com/
And by smatch via Dan Carpenter and the kernel test robot:
https://lore.kernel.org/all/202207101328.ASjx88yj-lkp@intel.com/
Security readout for executives and security teams
Plain-English summary
CVE-2022-50170 is a Linux kernel memory leak in KUnit, the kernel unit testing framework. The issue occurs on an allocation-failure path while filtering tests. Available sources do not show active exploitation, CVSS scoring, or normal remote attack exposure.
Executive priority
Handle as routine kernel maintenance, not an emergency response item, unless your organization runs affected custom kernels or KUnit-heavy test infrastructure at scale.
Technical view
In kunit_filter_tests, allocation for filtered can fail after a suite copy succeeds. The error path did not free copy, causing a leak. The kernel fix frees copy when filtered allocation fails. Reports came from clang-analyzer, smatch, and kernel test robot findings.
Likely exposure
Exposure appears limited to affected Linux kernel builds containing the vulnerable KUnit executor code, especially environments using KUnit test filtering. The provided data lists affected Linux versions including 5.19, 5.18.18, 5.19.2, and 6.0, but distribution backport status must be checked separately.
Exploitation context
The source bundle reports a memory leak found by static analysis and test automation. It does not provide evidence of active exploitation, public exploit code, KEV listing, privilege escalation, remote reachability, or production attack paths.
Researcher notes
The vulnerability is a narrow allocation-failure memory leak in KUnit executor logic. The record mentions a possibly similar historical issue in kunit_filter_subsuites, but that function was removed. Evidence is incomplete for exploitability beyond resource leakage.
Mitigation direction
Update to a kernel or distribution package containing the stable fix commits.
Check Linux distribution advisories for backported fixes to supported kernels.
Prioritize affected CI, development, and test systems that run KUnit.
Track vendor guidance if running custom or downstream kernel builds.
Validation and detection
Inventory running kernel versions and compare them with vendor fixed releases.
Confirm whether KUnit is enabled or used in affected build pipelines.
Review kernel package changelogs for the referenced stable commits.
Verify vulnerability scanner results against distribution backport information.
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.
cve · low confidence lookup
CVE-2022-50170 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
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.
0CVSS vectors
3Timeline events
0ADP providers
4Source links
Vulnerability timeline
Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.
CVE reservedCVE Program
The CVE ID was reserved by the assigning CNA.
CVE publishedCVE Program
The CVE record was published.
Jun 18, 2025, 11:03 UTC (UTC+00:00)
CVE updatedCVE Program
The CVE record metadata indicates this as the latest update time.