From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D6CC433E0 for ; Mon, 8 Feb 2021 12:46:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92D3664E37 for ; Mon, 8 Feb 2021 12:46:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92D3664E37 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VenRBBzJoamHD4xm+bOfJ7yaHlUvy9yrdqvs2oilyZw=; b=QL/eJ/Y5jxsP2naIr0lm+Dhdg iF1+A95KHdgzv2PcreeqmjCuMBXk2dt9s4LALmzSoRjLfD7ooqOYyimnlWp8qEiHrW1PXBS/8ua7p OxyjpmXkUZVHdHRDpGBKRZSjaVBY6D4QAqv0FsikzXuoRtT1pyhp0gcmzeeBMQbzMZxHrQSe6uzKh sGkmfDpqolbGi3Leif3BM+7dFrBc6RdY6Fmep9ZOAu61YJ8Le5PNo0xqQJTAXbZ73xPAyTkYEoVhJ aaTkCsXxUopCPbfqcRc2urdpbpkrFv5z0xrNipvMJ/yydF+ozfdj1kd/01aqkS0k6ftZgIG7UnANM bv3igzhEw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l95uX-000226-EC; Mon, 08 Feb 2021 12:45:01 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l95uU-00021l-Ar for linux-arm-kernel@lists.infradead.org; Mon, 08 Feb 2021 12:44:59 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2696264E75; Mon, 8 Feb 2021 12:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612788296; bh=joGcX7ry+qXT3vY2XFWkoLlSW/9qFLuMMnN/S3VXgaE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TZNYtuFve6qBenjWVHiIgFLqBnfsCETjJsAN92XTkWWuB/1d1aQxr5inomXKSdQbR UM4ONyjmlDOmV6pTRevGwZNo8GlLNIOWBPSUD4DspOgF86LQr3vC2kVffqwtY85f3v OWWZuE7L3meoXx7h3XcrV1HT2Oyvxag5OF4Btcu9cRjWbfAuQQR4lBzvdNQVKZmZhg /ElmHzM/37YrLP92+SiDPckD74us9NBhmPYR/HWPEh5ZL3qHeTC78XOOegNlimvt9e SYUIqDLqNMd7BHl4KGy3cUXKCeAMXh/mGy/91ifsZ2a4IPiD1Trq7wb52yLX311ali suo/N6kAzIBwQ== Date: Mon, 8 Feb 2021 12:44:51 +0000 From: Will Deacon To: Catalin Marinas Subject: Re: [PATCH] arm64: bti: Set PROT_BTI on all BTI executables mapped by the kernel Message-ID: <20210208124451.GB25618@willie-the-truck> References: <20210205173837.39315-1-broonie@kernel.org> <20210205175128.GB12697@gaia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210205175128.GB12697@gaia> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_074458_490405_057F77C1 X-CRM114-Status: GOOD ( 23.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , libc-alpha@sourceware.org, Kees Cook , Szabolcs Nagy , Jeremy Linton , Mark Brown , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Feb 05, 2021 at 05:51:29PM +0000, Catalin Marinas wrote: > On Fri, Feb 05, 2021 at 05:38:37PM +0000, Mark Brown wrote: > > Currently for dynamically linked executables the kernel only enables > > PROT_BTI for the interpreter, the interpreter is responsible for > > enabling it for everything else including the main executable. > > Unfortunately this interacts poorly with systemd's > > MemoryDenyWriteExecute feature which uses a seccomp filter to prevent > > setting PROT_EXEC on already mapped memory via mprotect(), it lacks the > > context to detect that PROT_EXEC is already set and so refuses to allow > > the mprotect() on the main executable which the kernel has already > > mapped. > > > > Since we don't want to force users to choose between having MDWX and BTI > > as these are othogonal features have the kernel enable PROT_BTI for all > > the ELF objects it loads, not just the dynamic linker. This means that > > if there is a problem with BTI it will be harder to disable at the > > executable level but we currently have no conditional support for this > > in any libc anyway so that would be new development. Ideally we would > > have interfaces that allowed us to more clearly specify what is enabled > > and disabled by a given syscall but this would be a far more difficult > > change to deploy. > > > > Reported-by: Jeremy Linton > > Suggested-by: Catalin Marinas > > Signed-off-by: Mark Brown > > Cc: Mark Rutland > > Cc: Szabolcs Nagy > > Cc: Dave Martin > > Cc: Kees Cook > > Cc: libc-alpha@sourceware.org > > Thanks Mark for putting the patch together. You may want to add a > reference to some of the discussions around the ABI, one of them: > > Link: https://lore.kernel.org/r/20201207200338.GB24625@arm.com/ > > (so we can keep Szabolcs accountable if something breaks ;)) > > For this patch: > > Reviewed-by: Catalin Marinas > > I wouldn't merge it as a fix yet but I'm ok with getting in 5.12 if Will > is ok. It would give us some time to revert. I'd like an Ack from Szabolcs before we queue this. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel