Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3965446ybi; Tue, 18 Jun 2019 09:20:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKJO+Vkl4UR2Pgyc9HUil8WY8FWneRdhuKLAwEoV4qDQINkchsrJESb+DfHa5mpg5RDwJ6 X-Received: by 2002:a17:902:7083:: with SMTP id z3mr49995585plk.205.1560874838991; Tue, 18 Jun 2019 09:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560874838; cv=none; d=google.com; s=arc-20160816; b=g3duASQTkHN+KR/rjdknKxFHbCZ4LQUtzLEGzKBUiw/2yczyaV9gFAxXRVUvKZHZ5Z WxKfA8KwmcxRoRMu8350i+j7FhGKBc/frSlPtmlLQbXVSx94YvwEdiHjXuUpynw72KE3 tQXiAptIsAS5ByL1sKEWYW3WUk3AOOmM6VzMwbn0Sbxw2kSrBUnSD7DxRdyr8U2F7hIc 5qIUx9zIcS29yigEvUY5XxiH6JVKbcjd19wNWJ7ZlmjmRJElyhOin/T1IYsEzM5gLLYR BTqHK7XZkrqUdy3ochyso6rjij5dbr80TV/s9YiaP2/NSCnr4lF/VD2vDh/Ix0cD58Mf m1yg== 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; bh=35xcTdgw1ipLMWHY+uaNl0cVLtglgLWKsfWDwYrtOVM=; b=VpiIiwXbAsdwoYOtXaJ9kphkADZ7frE/Zq/0Nc5qItSOdsroGq1iP87VJwZX6kvyzQ FFbTkEq4cF9rk/TPWsnP0v471bOnaxvDm0skueGMIWf/2iRRvL8zXsCdQ7WyKLimynmj 4W3rrhYSuP686+Yo7I8gC6APpxfiBky2g98a6TIkNqYjoW0tfE5YjJoc3vYWBz7H8+x+ GWNf7L6s59p1/UcSiiZXbU1RwwP3h312BiGJVluer/EpBuby4wRpCD8XXzcNRVz3n+me +4BnhmrfaguU7h4fH4enCkZkuoE4tTrP8/3/KAxXuYLhVdqvRO4JR+3iH5Gb93O9tMxo zbew== 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 68si13810400plc.269.2019.06.18.09.20.23; Tue, 18 Jun 2019 09:20:38 -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 S1729880AbfFRQUO (ORCPT + 99 others); Tue, 18 Jun 2019 12:20:14 -0400 Received: from foss.arm.com ([217.140.110.172]:48748 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729272AbfFRQUN (ORCPT ); Tue, 18 Jun 2019 12:20:13 -0400 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 B4DBB344; Tue, 18 Jun 2019 09:20:12 -0700 (PDT) Received: from e103592.cambridge.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 284273F246; Tue, 18 Jun 2019 09:20:09 -0700 (PDT) Date: Tue, 18 Jun 2019 17:20:07 +0100 From: Dave Martin To: Yu-cheng Yu Cc: Florian Weimer , Peter Zijlstra , Thomas Gleixner , x86@kernel.org, "H. Peter Anvin" , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Subject: Re: [PATCH v7 22/27] binfmt_elf: Extract .note.gnu.property from an ELF file Message-ID: <20190618162005.GF2790@e103592.cambridge.arm.com> References: <20190618091248.GB2790@e103592.cambridge.arm.com> <20190618124122.GH3419@hirez.programming.kicks-ass.net> <87ef3r9i2j.fsf@oldenburg2.str.redhat.com> <20190618125512.GJ3419@hirez.programming.kicks-ass.net> <20190618133223.GD2790@e103592.cambridge.arm.com> <87pnna7v1d.fsf@oldenburg2.str.redhat.com> <1ca57aaae8a2121731f2dcb1a137b92eed39a0d2.camel@intel.com> <87blyu7ubf.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On Tue, Jun 18, 2019 at 09:00:35AM -0700, Yu-cheng Yu wrote: > On Tue, 2019-06-18 at 18:05 +0200, Florian Weimer wrote: > > * Yu-cheng Yu: > > > > > > I assumed that it would also parse the main executable and make > > > > adjustments based on that. > > > > > > Yes, Linux also looks at the main executable's header, but not its > > > NT_GNU_PROPERTY_TYPE_0 if there is a loader. > > > > > > > > > > > ld.so can certainly provide whatever the kernel needs. We need to tweak > > > > the existing loader anyway. > > > > > > > > No valid statically-linked binaries exist today, so this is not a > > > > consideration at this point. > > > > > > So from kernel, we look at only PT_GNU_PROPERTY? > > > > If you don't parse notes/segments in the executable for CET, then yes. > > We can put PT_GNU_PROPERTY into the loader. > > Thanks! Would this require the kernel and ld.so to be updated in a particular order to avoid breakage? I don't know enough about RHEL to know how controversial that might be. Also: What about static binaries distrubited as part of RHEL? A user would also reasonably expect static binaries built using the distro toolchain to work on top of the distro kernel... which might be broken by this. (When I say "broken" I mean that the binary would run, but CET protections would be silently turned off.) Cheers ---Dave