{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-47218","id":"CVE-2021-47218","title":"selinux: fix NULL-pointer dereference when hashtab allocation fails","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nselinux: fix NULL-pointer dereference when hashtab allocation fails\n\nWhen the hash table slot array allocation fails in hashtab_init(),\nh->size is left initialized with a non-zero value, but the h->htable\npointer is NULL. This may then cause a NULL pointer dereference, since\nthe policydb code relies on the assumption that even af","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nselinux: fix NULL-pointer dereference when hashtab allocation fails\n\nWhen the hash table slot array allocation fails in hashtab_init(),\nh->size is left initialized with a non-zero value, but the h->htable\npointer is NULL. This may then cause a NULL pointer dereference, since\nthe policydb code relies on the assumption that even after a failed\nhashtab_init(), hashtab_map() and hashtab_destroy() can be safely called\non it. Yet, these detect an empty hashtab only by looking at the size.\n\nFix this by making sure that hashtab_init() always leaves behind a valid\nempty hashtab when the allocation fails.","published":"2024-04-10T19:01:57.060Z","updated":"2026-06-17T04:16:56.023Z","reserved":"2024-04-10T18:59:19.528Z","status":"Analyzed","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"OSV"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"03414a49ad5f3c56988c36d2070e402ffa17feaf","lessThan":"b17dd53cac769dd13031b0ca34f90cc65e523fab","status":"affected","versionType":"git"},{"version":"03414a49ad5f3c56988c36d2070e402ffa17feaf","lessThan":"83c8ab8503adf56bf68dafc7a382f4946c87da79","status":"affected","versionType":"git"},{"version":"03414a49ad5f3c56988c36d2070e402ffa17feaf","lessThan":"dc27f3c5d10c58069672215787a96b4fae01818b","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","lessThan":"5.8","status":"unaffected","versionType":"semver"},{"version":"5.10.82","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.5","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"5.16","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-476"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/b17dd53cac769dd13031b0ca34f90cc65e523fab","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/83c8ab8503adf56bf68dafc7a382f4946c87da79","tags":["x_transferred","Patch","fix"]},{"url":"https://git.kernel.org/stable/c/dc27f3c5d10c58069672215787a96b4fae01818b","tags":["x_transferred","Patch","fix"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.00225,"epssPercentile":0.13319,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-47218","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-47218","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-47218","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-47218","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}