summaryrefslogtreecommitdiffstats
path: root/security/apparmor/policy.c
diff options
context:
space:
mode:
authorFedor Pchelkin <pchelkin@ispras.ru>2024-02-01 17:24:48 +0300
committerJohn Johansen <john.johansen@canonical.com>2024-05-10 08:32:35 -0700
commit2bc73505a5cd2a18a7a542022722f136c19e3b87 (patch)
treefc10914b179c6f2ab2af130e758a51d7d8f0249f /security/apparmor/policy.c
parentfce09ea314505a52f2436397608fa0a5d0934fb1 (diff)
downloadlinux-stable-2bc73505a5cd2a18a7a542022722f136c19e3b87.tar.gz
linux-stable-2bc73505a5cd2a18a7a542022722f136c19e3b87.tar.bz2
linux-stable-2bc73505a5cd2a18a7a542022722f136c19e3b87.zip
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: 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>
Diffstat (limited to 'security/apparmor/policy.c')
-rw-r--r--security/apparmor/policy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/policy.c b/security/apparmor/policy.c
index 957654d253dd..14df15e35695 100644
--- a/security/apparmor/policy.c
+++ b/security/apparmor/policy.c
@@ -225,7 +225,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);
}