diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-16 00:06:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-01-16 00:06:39 -0500 |
commit | 47bfa6d9dc8c060bf56554a465c9031e286d2f80 (patch) | |
tree | 38cf7c197fb9bc7d5a6e70638087571575a7e1ec /security/selinux | |
parent | 7939f8beecf1cfb10d255be65bfbd3793fae82a1 (diff) | |
parent | 5b0e7310a2a33c06edc7eb81ffc521af9b2c5610 (diff) |
Merge tag 'selinux-pr-20190115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull SELinux fix from Paul Moore:
"One small patch to fix a potential NULL dereference on a failed
SELinux policy load"
* tag 'selinux-pr-20190115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: fix GPF on invalid policy
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/ss/policydb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index a50d625e7946..c1c31e33657a 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -732,7 +732,8 @@ static int sens_destroy(void *key, void *datum, void *p) | |||
732 | kfree(key); | 732 | kfree(key); |
733 | if (datum) { | 733 | if (datum) { |
734 | levdatum = datum; | 734 | levdatum = datum; |
735 | ebitmap_destroy(&levdatum->level->cat); | 735 | if (levdatum->level) |
736 | ebitmap_destroy(&levdatum->level->cat); | ||
736 | kfree(levdatum->level); | 737 | kfree(levdatum->level); |
737 | } | 738 | } |
738 | kfree(datum); | 739 | kfree(datum); |