apparmor: fix missing error check for rhashtable_insert_fast
authorDanila Chernetsov <listdansp@mail.ru>
Tue, 4 Apr 2023 19:05:49 +0000 (19:05 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:22:07 +0000 (16:22 +0200)
commite9fbb7c2f65e900fc6505274f70cd9db3c876667
treee9774147f127f8029d915fd497e58b7a983e598c
parent8fb11fa4805699c6b73a9c8a9d45807f9874abe3
apparmor: fix missing error check for rhashtable_insert_fast

[ Upstream commit 000518bc5aef25d3f703592a0296d578c98b1517 ]

 rhashtable_insert_fast() could return err value when memory allocation is
 failed. but unpack_profile() do not check values and this always returns
 success value. This patch just adds error check code.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: e025be0f26d5 ("apparmor: support querying extended trusted helper extra data")

Signed-off-by: Danila Chernetsov <listdansp@mail.ru>
Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/apparmor/policy_unpack.c