ima/policy: fix parsing of fsuuid
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Wed, 17 Jan 2018 18:27:11 +0000 (20:27 +0200)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 18 Jan 2018 21:52:49 +0000 (16:52 -0500)
The switch to uuid_t invereted the logic of verfication that &entry->fsuuid
is zero during parsing of "fsuuid=" rule. Instead of making sure the
&entry->fsuuid field is not attempted to be overwritten, we bail out for
perfectly correct rule.

Fixes: 787d8c530af7 ("ima/policy: switch to use uuid_t")

Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_policy.c

index 93dcf1b..915f557 100644 (file)
@@ -765,7 +765,7 @@ static int ima_parse_rule(char *rule, struct ima_rule_entry *entry)
                case Opt_fsuuid:
                        ima_log_string(ab, "fsuuid", args[0].from);
 
-                       if (uuid_is_null(&entry->fsuuid)) {
+                       if (!uuid_is_null(&entry->fsuuid)) {
                                result = -EINVAL;
                                break;
                        }