apparmor: use kvfree_sensitive to free data->data

Inside unpack_profile() data->data is allocated using kvmemdup() so it
should be freed with the corresponding kvfree_sensitive().

Also add missing data->data release for rhashtable insertion failure path
in unpack_profile().

Found by Linux Verification Center (linuxtesting.org).

Fixes: e025be0f26 ("apparmor: support querying extended trusted helper extra data")
Cc: stable@vger.kernel.org
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Fedor Pchelkin 2024-02-01 17:24:48 +03:00 • committed by John Johansen
commit 2bc73505a5
2 changed files with 2 additions and 1 deletions