diff options
author | 2022-05-18 14:15:35 -1000 | |
---|---|---|
committer | 2022-05-18 14:15:35 -1000 | |
commit | 6899c161313671ca37a7a56429a3a80dad56ee8a (patch) | |
tree | 2da24fec869bacf725855aff01335ea0544cfb34 | |
parent | Merge branch 'arm/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc (diff) | |
parent | selinux: fix bad cleanup on error in hashtab_duplicate() (diff) | |
download | linux-dev-6899c161313671ca37a7a56429a3a80dad56ee8a.tar.xz linux-dev-6899c161313671ca37a7a56429a3a80dad56ee8a.zip |
Merge tag 'selinux-pr-20220518' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore:
"A single SELinux patch to fix an error path that was doing the wrong
thing with respect to freeing memory"
* tag 'selinux-pr-20220518' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: fix bad cleanup on error in hashtab_duplicate()
-rw-r--r-- | security/selinux/ss/hashtab.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/ss/hashtab.c b/security/selinux/ss/hashtab.c index 0ae4e4e57a40..3fb8f9026e9b 100644 --- a/security/selinux/ss/hashtab.c +++ b/security/selinux/ss/hashtab.c @@ -179,7 +179,8 @@ int hashtab_duplicate(struct hashtab *new, struct hashtab *orig, kmem_cache_free(hashtab_node_cachep, cur); } } - kmem_cache_free(hashtab_node_cachep, new); + kfree(new->htable); + memset(new, 0, sizeof(*new)); return -ENOMEM; } |