summaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/services.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-21 15:41:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-21 15:41:24 -0700
commit817d914d17651c188f28a284261ff6091d80ad2c (patch)
tree8916eba51e95090dec075f4af2e161f399734950 /security/selinux/ss/services.c
parent16f4aa9b7c2304e439796bd097b2c0a7663f5d6e (diff)
parent8231b0b9c322c894594fb42eb0eb9f93544a6acc (diff)
downloadlinux-stable-817d914d17651c188f28a284261ff6091d80ad2c.tar.gz
linux-stable-817d914d17651c188f28a284261ff6091d80ad2c.tar.bz2
linux-stable-817d914d17651c188f28a284261ff6091d80ad2c.zip
Merge tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull SELinux fixes from Paul Moore: "Three small patches to fix problems in the SELinux code, all found via clang. Two patches fix potential double-free conditions and one fixes an undefined return value" * tag 'selinux-pr-20200621' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix undefined return of cond_evaluate_expr selinux: fix a double free in cond_read_node()/cond_read_list() selinux: fix double free
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r--security/selinux/ss/services.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 313919bd42f8..ef0afd878bfc 100644
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -2888,8 +2888,12 @@ err:
if (*names) {
for (i = 0; i < *len; i++)
kfree((*names)[i]);
+ kfree(*names);
}
kfree(*values);
+ *len = 0;
+ *names = NULL;
+ *values = NULL;
goto out;
}