{"id":"CVE-2021-47218","published":"2024-04-10T19:01:57Z","modified":"2026-05-11T13:50:16Z","title":"selinux: fix NULL-pointer dereference when hashtab allocation fails","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.00305,"percentile":0.15697,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/b17dd53cac769dd13031b0ca34f90cc65e523fab","tags":[]},{"url":"https://git.kernel.org/stable/c/83c8ab8503adf56bf68dafc7a382f4946c87da79","tags":[]},{"url":"https://git.kernel.org/stable/c/dc27f3c5d10c58069672215787a96b4fae01818b","tags":[]}],"priority":{"score":3.1,"factors":[{"name":"EPSS percentile","points":3.14}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 03414a49ad5f3c56988c36d2070e402ffa17feaf, < b17dd53cac769dd13031b0ca34f90cc65e523fab",">= 03414a49ad5f3c56988c36d2070e402ffa17feaf, < 83c8ab8503adf56bf68dafc7a382f4946c87da79",">= 03414a49ad5f3c56988c36d2070e402ffa17feaf, < dc27f3c5d10c58069672215787a96b4fae01818b"]},{"vendor":"Linux","product":"Linux","versions":["5.8"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2024-04-15T15:01:50.328604Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2021-33866","exploited":false,"provenance":"source"}}