]> git.baikalelectronics.ru Git - kernel.git/commit
integrity: Fix memory leakage in keyring allocation error path
authorGUO Zihua <guozihua@huawei.com>
Fri, 11 Nov 2022 10:13:17 +0000 (18:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:03 +0000 (11:41 +0100)
commitac013e2a9b9d0054cae15b70bca6f2dfd5b6953e
tree5d2ad86071b4db3bb0a8f21b61db4be018964986
parentfd44c792394c28c9f3c828883b0828007b66cfae
integrity: Fix memory leakage in keyring allocation error path

[ Upstream commit 39419ef7af0916cc3620ecf1ed42d29659109bf3 ]

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

Fixes: b072e1c2e6eb ("KEYS: Use structure to capture key restriction function and data")
Signed-off-by: GUO Zihua <guozihua@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/integrity/digsig.c