Merge tag 'integrity-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar...
[sfrench/cifs-2.6.git] / security / integrity / ima / ima_policy.c
index 9b5adeaa47fc819c4c9fc6396871db2848770505..823a0c1379cb3997b12fa0964aec45f822076713 100644 (file)
@@ -628,7 +628,7 @@ int ima_match_policy(struct inode *inode, const struct cred *cred, u32 secid,
        struct ima_rule_entry *entry;
        int action = 0, actmask = flags | (flags << 1);
 
-       if (template_desc)
+       if (template_desc && !*template_desc)
                *template_desc = ima_template_desc_current();
 
        rcu_read_lock();