Smack: Use GFP_KERNEL for smk_netlbl_mls().
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 14 Nov 2016 11:12:56 +0000 (20:12 +0900)
committerCasey Schaufler <casey@schaufler-ca.com>
Tue, 4 Apr 2017 22:41:15 +0000 (15:41 -0700)
Since all callers of smk_netlbl_mls() are GFP_KERNEL context
(smk_set_cipso() calls memdup_user_nul(), init_smk_fs() calls
__kernfs_new_node(), smk_import_entry() calls kzalloc(GFP_KERNEL)),
it is safe to use GFP_KERNEL from netlbl_catmap_setbit().

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

index 356e3764cad9e93b80dfeac5a3010e391e9339c1..a4b2e6b94abd49f8dde1aa04c4f61f99b40a0ff5 100644 (file)
@@ -504,7 +504,7 @@ int smk_netlbl_mls(int level, char *catset, struct netlbl_lsm_secattr *sap,
                        if ((m & *cp) == 0)
                                continue;
                        rc = netlbl_catmap_setbit(&sap->attr.mls.cat,
-                                                 cat, GFP_ATOMIC);
+                                                 cat, GFP_KERNEL);
                        if (rc < 0) {
                                netlbl_catmap_free(sap->attr.mls.cat);
                                return rc;