]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
ima/policy: fix parsing of fsuuid
authorMike Rapoport <rppt@linux.vnet.ibm.com>
Thu, 15 Mar 2018 19:56:00 +0000 (20:56 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 28 Mar 2018 09:17:10 +0000 (11:17 +0200)
BugLink: http://bugs.launchpad.net/bugs/1755804
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>
(cherry picked from commit 36447456e1cca853188505f2a964dbbeacfc7a7a)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Khaled Elmously <khalid.elmously@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
security/integrity/ima/ima_policy.c

index 95209a5f8595aff48c253d509eb4c93c6f674ce7..8daf16e1d421d491a5c4c39aa160205121cd928d 100644 (file)
@@ -743,7 +743,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;
                        }