Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757772AbbEVQRZ (ORCPT ); Fri, 22 May 2015 12:17:25 -0400 Received: from mx5.ptsecurity.com ([45.58.112.35]:33216 "EHLO mx5.ptsecurity.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757316AbbEVQRX (ORCPT ); Fri, 22 May 2015 12:17:23 -0400 X-Greylist: delayed 901 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 May 2015 12:17:23 EDT From: Alexander Popov To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrey Ryabinin , Andrey Konovalov , Denys Vlasenko , Andy Lutomirski , Alexander Kuleshov , Alexander Popov , "Sergey Kovalev" , , Subject: [PATCH 1/1] x86_64: fix KASan shadow region page tables Date: Fri, 22 May 2015 19:03:01 +0300 Message-ID: <1432310581-11965-1-git-send-email-alpopov@ptsecurity.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: DC1-CAS-01.ptsecurity.ru (10.0.52.114) To dc1-mbx-01.ptsecurity.ru (10.0.52.116) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1157 Lines: 41 Physical addresses in KASan shadow region page tables need fixup: kernel halts without it if phys_base is not zero. Signed-off-by: Alexander Popov --- arch/x86/kernel/head_64.S | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index ae6588b..f7711bb 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -95,6 +95,20 @@ startup_64: addq %rbp, level2_fixmap_pgt + (506*8)(%rip) +#ifdef CONFIG_KASAN + xor %rax, %rax + leaq kasan_zero_pud(%rip), %rbx + leaq kasan_zero_pmd(%rip), %rcx + leaq kasan_zero_pte(%rip), %rdx +1: + addq %rbp, (%rbx,%rax,8) + addq %rbp, (%rcx,%rax,8) + addq %rbp, (%rdx,%rax,8) + inc %rax + cmp $512, %rax + jne 1b +#endif + /* * Set up the identity mapping for the switchover. These * entries should *NOT* have the global bit set! This also -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/