From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB588134CC2 for ; Wed, 10 Apr 2024 19:02:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775762; cv=none; b=SRe8Y6kZ4C7mFrcN/ZDQxSH8KvcZb9iwqbGh7+iVRptYckon2tNB5xhRtlQ15g/XS0RT9LMsvJiLh5UuPhcEUtXJ4zhghLMfbN9XOhNcqzw6kDF8CH/BXkaZZO1mUujyKVQ4BKa51ULzHTMlmqHfnAWbSRjEWWS6aQhanX1jk6U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712775762; c=relaxed/simple; bh=FFCDFPYeNBVGAGudy5jsYCQjx5fwT/UwKAvtgP7upNM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=bEh1vBvuR/n61v6Y1XGVa70mR+k4KZ9mQvtCuvSGeJSbHcNzfDrOeLeE+bviCI4VpNC95yFQ8wnxIH6BUE95dvfSkoD3RSKiHOyComv6oNnx7sgGshBPKJNyITLtBU8KoKKKXIaRkwHOu0X7urx+ij6NG+JjnkuGulEv9Sb9CXk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j5NkuxKW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="j5NkuxKW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3653EC433C7; Wed, 10 Apr 2024 19:02:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712775762; bh=FFCDFPYeNBVGAGudy5jsYCQjx5fwT/UwKAvtgP7upNM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=j5NkuxKWO4ElOITHmHtjQfEuQo31fYdgOoV69M+L4QkpCyYSUyQm6SUmTiQVbM1IE 6y66A0cQcmVr0vVtDzJq9bhivkewRR6q6W8txgyNq0dlVIpyq/nPaL7q/hBVvHDN0G OgJLV5PTO6Ian/gjKnQoUAixd9MvQDFw7uHr99Mw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47218: selinux: fix NULL-pointer dereference when hashtab allocation fails Date: Wed, 10 Apr 2024 21:02:11 +0200 Message-ID: <2024041006-CVE-2021-47218-cdc8@gregkh> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2379; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FFCDFPYeNBVGAGudy5jsYCQjx5fwT/UwKAvtgP7upNM=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlij/R4Z1uxnuBTc1coEd/59d/ft11fOXMv7TV7piOe/ mqRWNiLjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjIDCOGBZM2NH5wevqm6P+J e8UTwvZccn1g+olhrhDbJ5tTHRabrv8VXzlzX5emtWnrHQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit 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. The Linux kernel CVE team has assigned CVE-2021-47218 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 03414a49ad5f and fixed in 5.10.82 with commit b17dd53cac76 Issue introduced in 5.8 with commit 03414a49ad5f and fixed in 5.15.5 with commit 83c8ab8503ad Issue introduced in 5.8 with commit 03414a49ad5f and fixed in 5.16 with commit dc27f3c5d10c Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2021-47218 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: security/selinux/ss/hashtab.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/b17dd53cac769dd13031b0ca34f90cc65e523fab https://git.kernel.org/stable/c/83c8ab8503adf56bf68dafc7a382f4946c87da79 https://git.kernel.org/stable/c/dc27f3c5d10c58069672215787a96b4fae01818b