Smack: Use GFP_KERNEL for smack_parse_opts_str().
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 14 Nov 2016 11:12:55 +0000 (20:12 +0900)
committerCasey Schaufler <casey@schaufler-ca.com>
Mon, 14 Nov 2016 20:55:11 +0000 (12:55 -0800)
Since smack_parse_opts_str() is calling match_strdup() which uses
GFP_KERNEL, it is safe to use GFP_KERNEL from kcalloc() which is
called by smack_parse_opts_str().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smack_lsm.c

index b2c839f735c0dd5ae1e9f1db40ccb0fec1d026f3..46d8be4344666abac5f7c221401359c38ebf2b63 100644 (file)
@@ -692,12 +692,12 @@ static int smack_parse_opts_str(char *options,
                }
        }
 
-       opts->mnt_opts = kcalloc(NUM_SMK_MNT_OPTS, sizeof(char *), GFP_ATOMIC);
+       opts->mnt_opts = kcalloc(NUM_SMK_MNT_OPTS, sizeof(char *), GFP_KERNEL);
        if (!opts->mnt_opts)
                goto out_err;
 
        opts->mnt_opts_flags = kcalloc(NUM_SMK_MNT_OPTS, sizeof(int),
-                       GFP_ATOMIC);
+                       GFP_KERNEL);
        if (!opts->mnt_opts_flags) {
                kfree(opts->mnt_opts);
                goto out_err;