CVE-2021-47218selinux: fix NULL-pointer dereference when hashtab allocation fails
- 5.5MediumCVSS base score
- 0.22%Exploitation in 30 daysEPSS · top 87% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
In the Linux kernel, the following vulnerability has been resolved: selinux: fix NULL-pointer dereference when hashtab allocation fails When the hash table slot array allocation fails in hashtab_init(), h->size is left initialized with a non-zero value, but the h->htable pointer is NULL. This may then cause a NULL pointer dereference, since the policydb code relies on the assumption that even after a failed hashtab_init(), hashtab_map() and hashtab_destroy() can be safely called on it. Yet, these detect an empty hashtab only by looking at the size. Fix this by making sure that hashtab_init() always leaves behind a valid empty hashtab when the allocation fails.
Timeline
ID reserved
By Linux
Published
- 2 years later
· 2 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Analyzed | 3.1 | Medium5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 0.22% · top 87% of all CVEs (17 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: Medium 5.5.
Affected products
- affected 03414a49ad5f3c56988c36d2070e402ffa17feaf – < b17dd53cac769dd13031b0ca34f90cc65e523fab
- affected 03414a49ad5f3c56988c36d2070e402ffa17feaf – < 83c8ab8503adf56bf68dafc7a382f4946c87da79
- affected 03414a49ad5f3c56988c36d2070e402ffa17feaf – < dc27f3c5d10c58069672215787a96b4fae01818b
- affected 5.8
- unaffected < 5.8
- unaffected 5.10.82 – ≤ 5.10.*
- unaffected 5.15.5 – ≤ 5.15.*
- unaffected 5.16 – ≤ *
References
References3
- https://git.kernel.org/stable/c/b17dd53cac769dd13031b0ca34f90cc65e523fab (opens in a new tab)x_transferred
- https://git.kernel.org/stable/c/83c8ab8503adf56bf68dafc7a382f4946c87da79 (opens in a new tab)x_transferred
- https://git.kernel.org/stable/c/dc27f3c5d10c58069672215787a96b4fae01818b (opens in a new tab)x_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-33866 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisories (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-47218)Record last updated .