]> 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)
commitac3cfef5a66532df0f50e3ffd12d9f3503280012
tree5d2ad86071b4db3bb0a8f21b61db4be018964986
parent928adbb16c26d472a40f28383c33d861277104cd
integrity: Fix memory leakage in keyring allocation error path

[ Upstream commit 12483a7d26906e5cc276e67a95c5f06698c6e4ab ]

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

Fixes: 31f3de2d0d45 ("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