From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751951AbcKGT6p (ORCPT ); Mon, 7 Nov 2016 14:58:45 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:36811 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbcKGT6o (ORCPT ); Mon, 7 Nov 2016 14:58:44 -0500 MIME-Version: 1.0 In-Reply-To: <20161107194910.GM19796@leverpostej> References: <1477585654-8908-1-git-send-email-labbott@redhat.com> <20161030150307.33vc2m7y5y6wzbqc@localhost> <20161107153802.GJ19796@leverpostej> <20161107194910.GM19796@leverpostej> From: Ard Biesheuvel Date: Mon, 7 Nov 2016 19:58:42 +0000 Message-ID: Subject: Re: [kernel-hardening] Re: [PATCHv4 0/4] WX checking for arm64 To: Mark Rutland Cc: Catalin Marinas , Laura Abbott , AKASHI Takahiro , David Brown , Will Deacon , "linux-efi@vger.kernel.org" , Kees Cook , kernel-hardening@lists.openwall.com, Matt Fleming , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7 November 2016 at 19:49, Mark Rutland wrote: > On Mon, Nov 07, 2016 at 03:38:02PM +0000, Mark Rutland wrote: >> On Sun, Oct 30, 2016 at 03:03:07PM +0000, Catalin Marinas wrote: >> > On Thu, Oct 27, 2016 at 09:27:30AM -0700, Laura Abbott wrote: >> > > Laura Abbott (4): >> > > arm64: dump: Make ptdump debugfs a separate option >> > > arm64: dump: Make the page table dumping seq_file optional >> > > arm64: dump: Remove max_addr >> > > arm64: dump: Add checking for writable and exectuable pages >> > >> > Queued for 4.10. Thanks. >> >> Catalin mentioned to me that he saw some KASAN splats when testing; it >> looks like need a fixup something like the below. > > As an aside, it looks like any ptdump usage when KASAN is enabled takes > several minutes, which at boot time looks like a hang. > > AFAICT, this is because KASAN allocates *huge* VA ranges (4TB+) worth of > zeroed shadow memory at pte granularity (reusing the same pmd, pud, > tables), and the ptdump code dutifully walks this with, with the added > KASAN instrumentation overhead. > > I'll try to dig into that tomorrow; I suspect/hope it's not necessary to > keep all of that mapped. > I have noticed that in the past, but I see how this delay at boot time is an issue. However, I don't think there is a huge cost involved in terms of memory footprint: AFAIK, the same PMD/PTE/kasan zero page are mapped over and over across the range.