Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux...
[firefly-linux-kernel-4.4.55.git] / security / integrity / ima / ima_api.c
index f92be1b14089fb7abd1d64215c7ddeecace17e95..b8a27c5052d40811bcc6741a5b3e264cf2fed529 100644 (file)
@@ -173,8 +173,7 @@ int ima_get_action(struct inode *inode, int mask, int function)
 {
        int flags = IMA_MEASURE | IMA_AUDIT | IMA_APPRAISE;
 
-       if (!ima_appraise)
-               flags &= ~IMA_APPRAISE;
+       flags &= ima_policy_flag;
 
        return ima_match_policy(inode, function, mask, flags);
 }
@@ -325,11 +324,11 @@ const char *ima_d_path(struct path *path, char **pathbuf)
 {
        char *pathname = NULL;
 
-       *pathbuf = kmalloc(PATH_MAX, GFP_KERNEL);
+       *pathbuf = __getname();
        if (*pathbuf) {
                pathname = d_absolute_path(path, *pathbuf, PATH_MAX);
                if (IS_ERR(pathname)) {
-                       kfree(*pathbuf);
+                       __putname(*pathbuf);
                        *pathbuf = NULL;
                        pathname = NULL;
                }