diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-16 11:00:29 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-16 11:00:29 +0300 |
commit | 550ad8ef390cbd4c2efc7a8e398add2e753abe7e (patch) | |
tree | 78c6e9fddeb227f59d2755a23e325f42b544fc0a | |
parent | a090bd4ff8387c409732a8e059fbf264ea0bdd56 (diff) | |
parent | 023f108dcc187e34ef864bf10ed966cf25e14e2a (diff) | |
download | linux-550ad8ef390cbd4c2efc7a8e398add2e753abe7e.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull selinux fix from James Morris:
"Fix for a double free bug in SELinux"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
selinux: fix double free in selinux_parse_opts_str()
-rw-r--r-- | security/selinux/hooks.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e67a526d1f30..819fd6858b49 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1106,10 +1106,8 @@ static int selinux_parse_opts_str(char *options, opts->mnt_opts_flags = kcalloc(NUM_SEL_MNT_OPTS, sizeof(int), GFP_KERNEL); - if (!opts->mnt_opts_flags) { - kfree(opts->mnt_opts); + if (!opts->mnt_opts_flags) goto out_err; - } if (fscontext) { opts->mnt_opts[num_mnt_opts] = fscontext; @@ -1132,6 +1130,7 @@ static int selinux_parse_opts_str(char *options, return 0; out_err: + security_free_mnt_opts(opts); kfree(context); kfree(defcontext); kfree(fscontext); |