]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
kaiser: fix build and FIXME in alloc_ldt_struct()
authorHugh Dickins <hughd@google.com>
Mon, 4 Sep 2017 00:09:44 +0000 (17:09 -0700)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:20:06 +0000 (10:20 -0800)
Include linux/kaiser.h instead of asm/kaiser.h to build ldt.c without
CONFIG_KAISER.  kaiser_add_mapping() does already return an error code,
so fix the FIXME.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9b94cf97f42ca30fe9b5010900fa6e1d6855a9f6)
Orabug: 27333760
CVE: CVE-2017-5754
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/kernel/ldt.c

index 9c6ebaf0a83bd6777d309ea6c9268bc07c60ea06..c388247e03533c9fe64875ba5688e35a6b7b687e 100644 (file)
@@ -48,7 +48,7 @@ static struct ldt_struct *alloc_ldt_struct(int size)
 {
        struct ldt_struct *new_ldt;
        int alloc_size;
-       int ret = 0;
+       int ret;
 
        if (size > LDT_ENTRIES)
                return NULL;
@@ -76,10 +76,8 @@ static struct ldt_struct *alloc_ldt_struct(int size)
                return NULL;
        }
 
-       // FIXME: make kaiser_add_mapping() return an error code
-       // when it fails
-       kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size,
-                          __PAGE_KERNEL);
+       ret = kaiser_add_mapping((unsigned long)new_ldt->entries, alloc_size,
+                                __PAGE_KERNEL);
        if (ret) {
                __free_ldt_struct(new_ldt);
                return NULL;