summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2016-11-14 20:16:12 +0900
committerPaul Moore <paul@paul-moore.com>2016-11-14 15:03:38 -0500
commit8931c3bdb3bfbdfb3c86f590f517ed9acfed27d7 (patch)
treec03b746c6385cee324ba920b66ebceb0164f7b0e /security
parent07d9a380680d1c0eb51ef87ff2eab5c994949e69 (diff)
downloadop-kernel-dev-8931c3bdb3bfbdfb3c86f590f517ed9acfed27d7.zip
op-kernel-dev-8931c3bdb3bfbdfb3c86f590f517ed9acfed27d7.tar.gz
SELinux: Use GFP_KERNEL for selinux_parse_opts_str().
Since selinux_parse_opts_str() is calling match_strdup() which uses GFP_KERNEL, it is safe to use GFP_KERNEL from kcalloc() which is called by selinux_parse_opts_str(). Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/hooks.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 09fd610..d1b141e 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1100,11 +1100,12 @@ static int selinux_parse_opts_str(char *options,
}
rc = -ENOMEM;
- opts->mnt_opts = kcalloc(NUM_SEL_MNT_OPTS, sizeof(char *), GFP_ATOMIC);
+ opts->mnt_opts = kcalloc(NUM_SEL_MNT_OPTS, sizeof(char *), GFP_KERNEL);
if (!opts->mnt_opts)
goto out_err;
- opts->mnt_opts_flags = kcalloc(NUM_SEL_MNT_OPTS, sizeof(int), GFP_ATOMIC);
+ opts->mnt_opts_flags = kcalloc(NUM_SEL_MNT_OPTS, sizeof(int),
+ GFP_KERNEL);
if (!opts->mnt_opts_flags) {
kfree(opts->mnt_opts);
goto out_err;
OpenPOWER on IntegriCloud