Skip to contentSkip to conversation

CVE-2022-50395: integrity: Fix memory leakage in keyring allocation error path

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 18, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

integrity: Fix memory leakage in keyring allocation error path

Key restriction is allocated in integrity_init_keyring(). However, if keyring allocation failed, it is not freed, causing memory leaks.

The Linux kernel CVE team has assigned CVE-2022-50395 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 5.4.229 with commit 9b7c44885a07c5ee7f9bf3aa3c9c72fb110c8d22
	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 5.10.163 with commit 3bd737289c26be3cee4b9afaf61ef784a2af9d6e
	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 5.15.86 with commit 29d6c69ba4b96a1de0376e44e5f8b38b13ec8803
	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 6.0.16 with commit 57e49ad12f8f5df0c48e1710c54b147a05a10c32
	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 6.1.2 with commit c591c48842f08d30ec6b8416757831985ed9a315
	Issue introduced in 4.12 with commit 2b6aa412ff23a02ac777ad307249c60a839cfd25 and fixed in 6.2 with commit 39419ef7af0916cc3620ecf1ed42d29659109bf3

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-2022-50395

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/integrity/digsig.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/9b7c44885a07c5ee7f9bf3aa3c9c72fb110c8d22
	https://git.kernel.org/stable/c/3bd737289c26be3cee4b9afaf61ef784a2af9d6e
	https://git.kernel.org/stable/c/29d6c69ba4b96a1de0376e44e5f8b38b13ec8803
	https://git.kernel.org/stable/c/57e49ad12f8f5df0c48e1710c54b147a05a10c32
	https://git.kernel.org/stable/c/c591c48842f08d30ec6b8416757831985ed9a315
	https://git.kernel.org/stable/c/39419ef7af0916cc3620ecf1ed42d29659109bf3