Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1949649imm; Thu, 24 May 2018 03:28:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1RIqdPq+cRp53qI7hg7F27rUwJtokBpEBPFKgYM++g/QQWhTxauadtNsuzc6t/SL85p0q X-Received: by 2002:a62:990f:: with SMTP id d15-v6mr6616470pfe.115.1527157685547; Thu, 24 May 2018 03:28:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157685; cv=none; d=google.com; s=arc-20160816; b=q1hwUPEeBjUaLp42/kNXeaUgSmnoTmhM96hkb5ePbtXkI/bOKk9pPtdApKA+fqR1bb CBA/30YiQfIDqA6ofb4ni5hTO/ws2ab6L6lex9JRM3vwWPY4t6V9ht4/MNjoI9NlMTtV d4qcV3QgZVxyvGqyqFxn6xV2pSF09kw0wTv049ORSvPiIXqazd38T+eQWjWmjZsVIMjy t9GRvmWbcEkLrBWWzqTRtn2RCIhTXT9YK+00S5oNedWC2YkJso9eNyISWzzdg2/d4iPg K4QV/Lx4YPLSwamNMOXgMjvC6ENjfvn8jHYPM9W7ypyzhb+m3JXWTtm3nv0Ul+7mBqdi sRIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=DhTJqkT3WqC/n+xQg/Af6LsQ5EHhTGLL/Cgwum4aWSU=; b=nxRRN9aZWr3a3sgzmmPR9ZnM9t+fxIlkRFm7a8hXHtdtYD4k4AKcXJKEXMDrlbHTaq c2pItwpq8Iw3Q06mX1xggrLideIjzUCgbkW7wT9iteshD0C5K1h8ke/buB2pQY5TF+S1 vaIvVfmGwvDa/DUfTcffm7Lclu/084Dc5lMG9Jeb59uuKXQ0V8JLWJNIZt4/9nYny2io xP5MNduSjvdhkuKt49Vt23Fg8VT72+Qm51wljBaT8vSGnSazoW4hw/uDOjCIVR1UYLR/ JM2bskmL5jFpVQMHjBYrEue8vnrWTSYUonfWJC5mzuoxU4P45TC4bgRBs9Ux/ncVgVVJ IptA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 202-v6si16726523pgg.546.2018.05.24.03.27.51; Thu, 24 May 2018 03:28:05 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032065AbeEXK1Q (ORCPT + 99 others); Thu, 24 May 2018 06:27:16 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:40292 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030987AbeEXK1L (ORCPT ); Thu, 24 May 2018 06:27:11 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2F1A215AD; Thu, 24 May 2018 03:27:11 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F2C0F3F25D; Thu, 24 May 2018 03:27:10 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 08BB51AE3701; Thu, 24 May 2018 11:27:38 +0100 (BST) Date: Thu, 24 May 2018 11:27:38 +0100 From: Will Deacon To: Laura Abbott Cc: Catalin Marinas , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kees Cook , Peter Robinson Subject: Re: [PATCHv2] arm64: Make sure permission updates happen for pmd/pud Message-ID: <20180524102735.GA28425@arm.com> References: <20180523184346.487-1-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180523184346.487-1-labbott@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laura, On Wed, May 23, 2018 at 11:43:46AM -0700, Laura Abbott wrote: > Commit 15122ee2c515 ("arm64: Enforce BBM for huge IO/VMAP mappings") > disallowed block mappings for ioremap since that code does not honor > break-before-make. The same APIs are also used for permission updating > though and the extra checks prevent the permission updates from happening, > even though this should be permitted. This results in read-only permissions > not being fully applied. Visibly, this can occasionaly be seen as a failure > on the built in rodata test when the test data ends up in a section or > as an odd RW gap on the page table dump. Fix this by using > pgattr_change_is_safe instead of p*d_present for determining if the > change is permitted. > > Reported-by: Peter Robinson > Fixes: 15122ee2c515 ("arm64: Enforce BBM for huge IO/VMAP mappings") > Signed-off-by: Laura Abbott > --- > v2: Switch to using pgattr_change_is_safe per suggestion of Will > --- Thanks for re-spinning so quickly. I'll queue as a fix with the relevant tags. Will