Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5436199pxu; Thu, 22 Oct 2020 02:10:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlhhn2rFy+5smePyFbBs5uOcTD1v9ccGOi/2d/3Sd9B3wF9Z7HLM/oeDDDfQR/aNHSiEMx X-Received: by 2002:aa7:d64e:: with SMTP id v14mr1370130edr.66.1603357809904; Thu, 22 Oct 2020 02:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603357809; cv=none; d=google.com; s=arc-20160816; b=hh9z0CyAJrrZRS5hMUJwWLr2lVpnD4NwuH+t3GQY9M2hCB5lcneAtU293LOA0Qm1rB Ckh4eH1Dsc0YZj10RwcAHAiBXhaw4U2Zs7EmbNoYIyeR7MenvALRmn8Mou4Lc/nMbmWQ yjs0uFFhUeWTjxmpo5sc+owGDO4UNWcd6SaPWcIhM68oO7lcbYxvARRAZhmk0KY/Eoeu u5f8vFj8PcYflFSrxyJVQSslExx4vAI6tAhNVTxI0YEpjC8llDKCAxFFo06ZkWPVYDSl l5hedSGNy3CjWOJCbHrQZpemUTb+yS6bvv+HPgt+ak94meu03x7e8H+BXCXvd/8jMo7N +uYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=q+bZWhHjtwxBtA/vjIP5WCCEDEtKJaw2ga82JqW9jIY=; b=vws050XCdUd1VDA1+B4uuYA1Lqqt+OHXNod+nk+vcFN4FJHGtavD5aThPTMXVm/jPd 0Zo9iWNfeoPzZyJFUA7Q2KepkZJAatVRVsBB4qdHPGY5sK/bqa3NHCzsUnQTHzqZkLK4 ANbagy18Umc0Om0VZdhJGEQfBw4NXV1ggi+tCkYm21wVNhGmW5TVdz0TRwKXmsVOWTfS 1kzHPhpFMB7F3NiYxHZnVde3wjMwynjIqk3xvTuoS6uMf7VSgWxmXHGbaUVElUTlOE0l s4bgig/2vsNlZEz8VBj9tZ5NsV3Cp5wscnDCdlgXlaWccZXyamc3cqboau479+g2PCy0 RTtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc22si477113ejb.708.2020.10.22.02.09.47; Thu, 22 Oct 2020 02:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2509376AbgJVIi0 (ORCPT + 99 others); Thu, 22 Oct 2020 04:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2508194AbgJVIiZ (ORCPT ); Thu, 22 Oct 2020 04:38:25 -0400 Received: from gardel.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33221C0613CE for ; Thu, 22 Oct 2020 01:38:25 -0700 (PDT) Received: from gardel-login.0pointer.net (gardel.0pointer.net [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by gardel.0pointer.net (Postfix) with ESMTP id 935E6E8080C; Thu, 22 Oct 2020 10:38:23 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 1C0A5160834; Thu, 22 Oct 2020 10:38:23 +0200 (CEST) Date: Thu, 22 Oct 2020 10:38:23 +0200 From: Lennart Poettering To: Szabolcs Nagy Cc: Topi Miettinen , Florian Weimer , Mark Rutland , systemd-devel@lists.freedesktop.org, Kees Cook , Catalin Marinas , Will Deacon , "linux-kernel@vger.kernel.org" , Mark Brown , libc-alpha@sourceware.org, Dave Martin , "linux-arm-kernel@lists.infradead.org" Subject: Re: [systemd-devel] BTI interaction between seccomp filters in systemd and glibc mprotect calls, causing service failures Message-ID: <20201022083823.GA324825@gardel-login> References: <8584c14f-5c28-9d70-c054-7c78127d84ea@arm.com> <20201022071812.GA324655@gardel-login> <87sga6snjn.fsf@oldenburg2.str.redhat.com> <511318fd-efde-f2fc-9159-9d16ac8d33a7@gmail.com> <20201022082912.GQ3819@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201022082912.GQ3819@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Do, 22.10.20 09:29, Szabolcs Nagy (szabolcs.nagy@arm.com) wrote: > > > The dynamic loader has to process the LOAD segments to get to the ELF > > > note that says to enable BTI. Maybe we could do a first pass and load > > > only the segments that cover notes. But that requires lots of changes > > > to generic code in the loader. > > > > What if the loader always enabled BTI for PROT_EXEC pages, but then when > > discovering that this was a mistake, mprotect() the pages without BTI? Then > > both BTI and MDWX would work and the penalty of not getting MDWX would fall > > to non-BTI programs. What's the expected proportion of BTI enabled code vs. > > disabled in the future, is it perhaps expected that a distro would enable > > the flag globally so eventually only a few legacy programs might be > > unprotected? > > i thought mprotect(PROT_EXEC) would get filtered > with or without bti, is that not the case? We can adjust the filter in systemd to match any combination of flags to allow and to deny. Lennart -- Lennart Poettering, Berlin