From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 896D13858004 for ; Tue, 15 Jun 2021 15:42:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 896D13858004 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1E42E13A1; Tue, 15 Jun 2021 08:42:12 -0700 (PDT) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D71B33F70D; Tue, 15 Jun 2021 08:42:10 -0700 (PDT) Date: Tue, 15 Jun 2021 16:41:08 +0100 From: Dave Martin To: Mark Brown Cc: linux-arch@vger.kernel.org, Yu-cheng Yu , libc-alpha@sourceware.org, Szabolcs Nagy , Catalin Marinas , Jeremy Linton , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 0/3] arm64: Enable BTI for the executable as well as the interpreter Message-ID: <20210615154106.GS4187@arm.com> References: <20210604112450.13344-1-broonie@kernel.org> <43e67d7b-aab9-db1f-f74b-a87ba7442d47@arm.com> <20210615152203.GR4187@arm.com> <20210615153341.GI5149@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210615153341.GI5149@sirena.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2021 15:42:13 -0000 On Tue, Jun 15, 2021 at 04:33:41PM +0100, Mark Brown via Libc-alpha wrote: > On Tue, Jun 15, 2021 at 04:22:06PM +0100, Dave Martin wrote: > > On Thu, Jun 10, 2021 at 11:28:12AM -0500, Jeremy Linton via Libc-alpha wrote: > > > > Thus, I expect that with his patch applied to 5.13 the service will fail to > > > start regardless of the state of MDWE, but it seems to continue starting > > > when I set MDWE=yes. Same behavior with v1 FWTW. > > > If the failure we're trying to detect is that BTI is undesirably left > > off for the main executable, surely replacing BTIs with NOPs will make > > no differenece? The behaviour with PROT_BTI clear is strictly more > > permissive than with PROT_BTI set, so I'm not sure we can test the > > behaviour this way. > > > Maybe I'm missing sometihng / confused myself somewhere. > > The issue this patch series is intended to address is that BTI gets > left off since the dynamic linker is unable to enable PROT_BTI on the > main executable. We're looking to see that we end up with the stricter > permissions checking of BTI, with the issue present landing pads > replaced by NOPs will not fault but once the issue is addressed they > should start faulting. Ah, right -- I got the test backwards in my head. Yes, that sounds reasonable. > > Looking at /proc//maps after the process starts up may be a more > > reliable approach, so see what the actual prot value is on the main > > executable's text pages. > > smaps rather than maps but yes, executable pages show up as "ex" and BTI > adds a "bt" tag in VmFlags. Fumbled that -- yes, I meant smaps! Ignore me... Cheers ---Dave