From b83083b9a22ec6d17d630b41b90f509f2b016fe6 Mon Sep 17 00:00:00 2001 From: "Balazs Gerofi bgerofi@riken.jp" Date: Fri, 10 May 2013 12:40:50 +0900 Subject: [PATCH] [Bug 16] malfunction of __clear_pt_page when a virtual address is accessed and at that time the corresponding PDTE is invalid: FIX large page issue --- arch/x86/kernel/memory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/memory.c b/arch/x86/kernel/memory.c index 34bcedd2..59a12db9 100644 --- a/arch/x86/kernel/memory.c +++ b/arch/x86/kernel/memory.c @@ -385,6 +385,11 @@ static int __clear_pt_page(struct page_table *pt, void *virt, int largepage) return 0; } } + + if ((pt->entry[l2idx] & PFL2_PRESENT)) { + return -EINVAL; + } + pt = phys_to_virt(pt->entry[l2idx] & PAGE_MASK); pt->entry[l1idx] = 0;