Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3951160ybi; Tue, 18 Jun 2019 09:07:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqCQnAgmzk+1vM0OtO9UQ5PyipeBP1wLBw0NSu39MkM84jfR4v6y4adU9ks5eBR5HLr6bp X-Received: by 2002:a17:902:3fa5:: with SMTP id a34mr110570092pld.317.1560874032388; Tue, 18 Jun 2019 09:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560874032; cv=none; d=google.com; s=arc-20160816; b=FWX8pJBTGaBEmjV7h/8f1OvjDcbUHuuNZ1OAxJ+hqb0zVn0SZXbts5FIfQOD+v+ECD YyrZc0Q/ErLkk8ipPE3khlwiV9FDiX2PeXN9f/jFxEU/1jOKb1JNCyHKOPslCD7q6rA+ dOZFoApZvK0oH+Cbvifjaj76iUyG5KrmdKWAZRQlT3LIbCr/KLzT4+nlRQGCp/Jo/JJR u11EGxAwNfRFqPJMjFbXjHDv1voZ491HHr2SnL0MTJQywX4Wkzp6AMeE0HUFDcbUc39F PEAyvonOs1vReM/woN87mAyzhdMR/aWdSGF34DvpEx9WL5B0b8ckIhjV+AXwF9eCYvut ddZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=R9lzACpyysqEMFTWath+L8VuA7EH+R6hsPpYBcFTTZc=; b=qhVsq1yiNMmxLmJsSHA7f9ajPQ95Tu4MUUW0GjHP+qeLZBf1fQScsbkXxM0wG85ULk m1oioQRKn5FnFAYPwkNt57hsFuQzUcdiXUZABP4BWAalfpTxWLuAc0q5fDmYOaSvbfLU tFdeL9jHkUBF98sLqYBFem4jSUhWI5xidrn2bcj/g5Z3rI/U9UT/CJLZ2NV/RqEOVCOS 2MjSqydDLS370Z1K6uoXBDH1YEtqzNAuvLQANh1ir6MZfzhAT+FQZcMzKR3R1XXNvcgo 4mzPoP1jVbtVDtwzJounuHbIz0/lIzBK4wKBZ3p1QdzdnPKx6LiOY33lmD/WZRblzJu1 Ofiw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 135si515591pgb.357.2019.06.18.09.06.56; Tue, 18 Jun 2019 09:07:12 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729810AbfFRQFu (ORCPT + 99 others); Tue, 18 Jun 2019 12:05:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59232 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729455AbfFRQFt (ORCPT ); Tue, 18 Jun 2019 12:05:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06BA17FDF9; Tue, 18 Jun 2019 16:05:39 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-87.ams2.redhat.com [10.36.116.87]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70CCD37DE; Tue, 18 Jun 2019 16:05:26 +0000 (UTC) From: Florian Weimer To: Yu-cheng Yu Cc: Dave Martin , 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 References: <87lfy9cq04.fsf@oldenburg2.str.redhat.com> <20190611114109.GN28398@e103592.cambridge.arm.com> <031bc55d8dcdcf4f031e6ff27c33fd52c61d33a5.camel@intel.com> <20190612093238.GQ28398@e103592.cambridge.arm.com> <87imt4jwpt.fsf@oldenburg2.str.redhat.com> <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> Date: Tue, 18 Jun 2019 18:05:24 +0200 In-Reply-To: <1ca57aaae8a2121731f2dcb1a137b92eed39a0d2.camel@intel.com> (Yu-cheng Yu's message of "Tue, 18 Jun 2019 08:53:29 -0700") Message-ID: <87blyu7ubf.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 18 Jun 2019 16:05:49 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * 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, Florian