Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp310711ybf; Wed, 26 Feb 2020 13:39:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwZ+cL1zXc8fog70SjgCGcoIQdjgzmKheZRT5XuadRvSbUBtKwoWxNy1cdhcnaVA82+R7bZ X-Received: by 2002:a9d:a68:: with SMTP id 95mr656354otg.87.1582753154620; Wed, 26 Feb 2020 13:39:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582753154; cv=none; d=google.com; s=arc-20160816; b=SmFgJQctzZCwa5NdF5jp8bF3MKLEnt9nS8eyAnZOtFNMzpZnyGQe0sQR8gRmjqdKsp FoNsR/gale48baFAPMzpDHT4uQ8JucRYQiXCaX3RitQiE9VXSUvK+QfCPZTeZnLzZ2vf v/giJePJIYZFiAB0uJtq+zFwFDV+V7WYiQPWLdOUne90+guQ+WUOnjq5LKoMMUaw8shU e1lqxdHY32dJqZDIzvKYf0qBIlVVZmdtkqZjN8oIEffTpiWKgDmBLhmH1MES3Y9DGr9K 8onRHm8pfvbjPBssbIfluT7049y9TvCalURiwmmbdyUDV+Eqm2ANbbEjHDEX18Lrsfk8 ngBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ICcEQ4gQdYyuJJyaNP/FXqF/GhkUX9RbcqCJbqfCFhk=; b=lG2zvilGPjMIOs5eox/JGyhHXhMNREcYGTljoHNOvSuwnBiYFqh9GwROgU00BNUvR+ 2kR7vbzbGi/7BOLhwoG7+GSV9LFpucqllxD60wfzHYIhgoweGN8cIgKCiTf10PzO7Wac 6fghYaVTJX0quLLgkR7fM38jKwgQO+0VMeLr3UkgOxw3Y38auO2Wxec983NdaZgwtht7 OAgsai7EytbesYAnLZddpGk9zo+5HezaemncHzgwU6U2SFZh6bPliJkP7I9mwpTAFGGO 069xJZDCKdo5+5EJiCyyU+GJ4bNyWw5mQlVcZtyTkNZ3TwC4aYLLiBDcJ+XdaeaAittC Bwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JK7mgAJh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si229979oih.141.2020.02.26.13.39.02; Wed, 26 Feb 2020 13:39:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JK7mgAJh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbgBZVi4 (ORCPT + 99 others); Wed, 26 Feb 2020 16:38:56 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:55872 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727552AbgBZViz (ORCPT ); Wed, 26 Feb 2020 16:38:55 -0500 Received: by mail-pj1-f66.google.com with SMTP id a18so194534pjs.5 for ; Wed, 26 Feb 2020 13:38:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ICcEQ4gQdYyuJJyaNP/FXqF/GhkUX9RbcqCJbqfCFhk=; b=JK7mgAJhIECWhL4BqCySSQ6RLJa9mVCEkRWbEgclZW6QParWyKb3pKOOzK7P7B2Fds QcJF8TMbhEkv9fkT27o5U2RrqdXSuHQHl3gd7Qlg7QioSGNbW/enlgGOtVHMRwsG9u/z ud39wkvioudcK1LY9iGaZX2XQoE68rMHqRca8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ICcEQ4gQdYyuJJyaNP/FXqF/GhkUX9RbcqCJbqfCFhk=; b=LP/RU1jGnCFgmKlvFYcOy792ZITLfL4rEfkd9DOoj2zXQzOTqrFu1bErj5Mcuq1Vgo yt3vU/0wq6k6vz7eg3JwbX4WdqjYdKGXfY9eiURwzAGPtnVO350cMMQzs5y710p+Y059 96HDwRFcsdYYk4nG8MD3XgJGM2Wl2K0SZ97pJ1rIDj+wV/vXwPWT4bwCEDNbW548Ue0j rB+Q9Rr/ZO0zCZFIjg+2WMPBLEIeDiVy40I1mjhr42Wyd8BDCMvJXxx4690WxnKfDGy+ SWjTQr/C1itgggtG/jyF1Taynt5XHgyKUpimD9fFyEJ/TuzJ1AwtPFFF7+mgtSBD3vdR WFRA== X-Gm-Message-State: APjAAAUg3Jt2k15jIV5spKIAfjob9hlgjnCSDf0LOwoO1uFebxBFvvd0 bojCniBPIB056RcKWankStqxfQ== X-Received: by 2002:a17:902:6ac3:: with SMTP id i3mr1273585plt.111.1582753134753; Wed, 26 Feb 2020 13:38:54 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x197sm188503pfc.47.2020.02.26.13.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 13:38:53 -0800 (PST) Date: Wed, 26 Feb 2020 13:38:53 -0800 From: Kees Cook To: Mark Brown Cc: Catalin Marinas , Will Deacon , Alexander Viro , Paul Elliott , Peter Zijlstra , Yu-cheng Yu , Amit Kachhap , Vincenzo Frascino , Marc Zyngier , Eugene Syromiatnikov , Szabolcs Nagy , "H . J . Lu " , Andrew Jones , Arnd Bergmann , Jann Horn , Richard Henderson , Kristina =?utf-8?Q?Mart=C5=A1enko?= , Thomas Gleixner , Florian Weimer , Sudakshina Das , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v7 11/11] arm64: mm: Display guarded pages in ptdump Message-ID: <202002261338.9890367C@keescook> References: <20200226155714.43937-1-broonie@kernel.org> <20200226155714.43937-12-broonie@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226155714.43937-12-broonie@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 26, 2020 at 03:57:14PM +0000, Mark Brown wrote: > v8.5-BTI introduces the GP field in stage 1 translation tables which > indicates that blocks and pages with it set are guarded pages for which > branch target identification checks should be performed. Decode this > when dumping the page tables to aid debugging. > > Signed-off-by: Mark Brown Reviewed-by: Kees Cook -Kees > --- > arch/arm64/mm/dump.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c > index 860c00ec8bd3..78163b7a7dde 100644 > --- a/arch/arm64/mm/dump.c > +++ b/arch/arm64/mm/dump.c > @@ -145,6 +145,11 @@ static const struct prot_bits pte_bits[] = { > .val = PTE_UXN, > .set = "UXN", > .clear = " ", > + }, { > + .mask = PTE_GP, > + .val = PTE_GP, > + .set = "GP", > + .clear = " ", > }, { > .mask = PTE_ATTRINDX_MASK, > .val = PTE_ATTRINDX(MT_DEVICE_nGnRnE), > -- > 2.20.1 > -- Kees Cook