]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
apparmor: don't check for vmalloc_addr if kvzalloc() failed
authorJohn Johansen <john.johansen@canonical.com>
Wed, 15 Jun 2016 06:57:55 +0000 (09:57 +0300)
committerJiri Slaby <jslaby@suse.cz>
Fri, 27 Jan 2017 10:16:13 +0000 (11:16 +0100)
commit 3197f5adf539a3ee6331f433a51483f8c842f890 upstream.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
security/apparmor/match.c

index f9f57c626f54952ad355b45a9efcb837b50de00b..32b72eb3d988ee551c21fe6c8b7da55170efcea0 100644 (file)
@@ -75,14 +75,14 @@ static struct table_header *unpack_table(char *blob, size_t bsize)
                                     u32, be32_to_cpu);
                else
                        goto fail;
+               /* if table was vmalloced make sure the page tables are synced
+                * before it is used, as it goes live to all cpus.
+                */
+               if (is_vmalloc_addr(table))
+                       vm_unmap_aliases();
        }
 
 out:
-       /* if table was vmalloced make sure the page tables are synced
-        * before it is used, as it goes live to all cpus.
-        */
-       if (is_vmalloc_addr(table))
-               vm_unmap_aliases();
        return table;
 fail:
        kvfree(table);