diff options
author | Fedor Pchelkin <pchelkin@ispras.ru> | 2024-02-01 17:24:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-03 09:54:16 +0300 |
commit | 691aada75653d4b110dc37d43964cf29c6cf916d (patch) | |
tree | 4d9fc18d848b2e7b25060699de374ef59b7ae591 /security/apparmor/policy.c | |
parent | 4ccd37085976ea5d3c499b1e6d0b3f4deaf2cd5a (diff) | |
download | linux-691aada75653d4b110dc37d43964cf29c6cf916d.tar.xz |
apparmor: use kvfree_sensitive to free data->data
commit 2bc73505a5cd2a18a7a542022722f136c19e3b87 upstream.
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: e025be0f26d5 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security/apparmor/policy.c')
-rw-r--r-- | security/apparmor/policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c index 8a07793ce103..d9d3b3d776e1 100644 --- a/security/apparmor/policy.c +++ b/security/apparmor/policy.c @@ -188,7 +188,7 @@ static void aa_free_data(void *ptr, void *arg) { struct aa_data *data = ptr; - kfree_sensitive(data->data); + kvfree_sensitive(data->data, data->size); kfree_sensitive(data->key); kfree_sensitive(data); } |