VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Danila Chernetsov <listdansp@mail.ru> 2023-04-04 19:05:49 +0000 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:36:49 +0200 commit: 543731db0173252a835b9b43ca4c7c1203a1f41e parent: e9e33faea104381bac80ac79328f0540fc2969f2
Commit Summary:
apparmor: fix missing error check for rhashtable_insert_fast
Diffstat:
1 file changed, 7 insertions, 2 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c
index 278ed96c30a2..72aac376d3ed 100644
--- a/security/apparmor/policy_unpack.c
+++ b/security/apparmor/policy_unpack.c
@@ -1064,8 +1064,13 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
 				goto fail;
 			}
 
-			rhashtable_insert_fast(profile->data, &data->head,
-					       profile->data->p);
+			if (rhashtable_insert_fast(profile->data, &data->head,
+						   profile->data->p)) {
+				kfree_sensitive(data->key);
+				kfree_sensitive(data);
+				info = "failed to insert data to table";
+				goto fail;
+			}
 		}
 
 		if (!aa_unpack_nameX(e, AA_STRUCTEND, NULL)) {