From patchwork Tue Aug 20 09:57:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 171786 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4178261ily; Tue, 20 Aug 2019 02:58:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUNqhfhhUAaRUFWYaQH52SVHIU/Gj5U7dXnvrkacYCe8cERQboutq+i6iqgXxSYw3yT5AR X-Received: by 2002:a63:5f01:: with SMTP id t1mr21893983pgb.200.1566295113184; Tue, 20 Aug 2019 02:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566295113; cv=none; d=google.com; s=arc-20160816; b=re0xkBSYotG8VXfnsj1g5UD2Txet5yIVMuVjkVE8a0oEYOSC7CT4Wxrc9YRm7smEKJ bZos7W6KKMtUClq6a9EsBGbYyblwIf2u/S5m3cdg7ieG97SMGto5KWzclkB44qIGT3yt 1DCmxdGjcS1h6KML1Nq41s+N2VR2vkWRkoMBCFnQrl4R1Wmi42cQ7yqZENrJF9AUs/gY hMX7PIBsXDZOPVDOVVmoiepzGzZ+XorLtKKgpHqYG7DMjrZLU/fCBj6JTCInpjtv0Sjj sYRRniVfUzS67W3aBLKnJbht24qerTT4CwDYe+42qmyFw5kTbg4xhxFpoCCKhz9mHx76 cwAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=7rG7SbnDWDmiwpsZdiGShKrCJZ147ptd4jwxU9J1xWk=; b=Z2rn7Oa0fn/Sdu73N5riY+CAQwjDxeiDNX4PFGt64wwOtnleE1auEO2mRONqojX/G2 YUhEiUXxu6GKD8WsI4MMFkqldIqkFzxigOsdDFOSMbMbTcFn/Hxwu4PNDftuqyt+gu34 C0igar0C5agEMLIeSRxeuOSWNfh7GidpCSJjCrhF7Om1d1eNUsUg17scgFMRuTkQzDn0 iN9j6zyp4a7yH259LuG9nGFe/peXKb3bcrJaLq/+jvgeItprtsxSrvzm6YeDL9+BoRT7 py7rgpnDJ+W+iN5KttcnIwowOy3Mmx2GC3DUXn8MMaDzUaa7+2WronQm6HJSuyVMBACV T20Q== 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 i18si12655467pfa.23.2019.08.20.02.58.32; Tue, 20 Aug 2019 02:58:33 -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 S1729704AbfHTJ6c (ORCPT + 28 others); Tue, 20 Aug 2019 05:58:32 -0400 Received: from foss.arm.com ([217.140.110.172]:37860 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728414AbfHTJ6b (ORCPT ); Tue, 20 Aug 2019 05:58:31 -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 0617D344; Tue, 20 Aug 2019 02:58:31 -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 ESMTPA id A6A903F706; Tue, 20 Aug 2019 02:58:29 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, Kees Cook , Thomas Gleixner , Jann Horn , "H.J. Lu" , Eugene Syromiatnikov , Florian Weimer , Yu-cheng Yu , Peter Zijlstra Subject: [RFC PATCH 1/2] ELF: UAPI and Kconfig additions for ELF program properties Date: Tue, 20 Aug 2019 10:57:42 +0100 Message-Id: <1566295063-7387-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1566295063-7387-1-git-send-email-Dave.Martin@arm.com> References: <1566295063-7387-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pull the basic ELF definitions from Yu-Cheng Yu's series. Signed-off-by: Yu-cheng Yu Signed-off-by: Dave Martin --- This patch should be merged with the next patch. I kept it seprate for now to document where this code came from. --- fs/Kconfig.binfmt | 3 +++ include/uapi/linux/elf.h | 7 +++++++ 2 files changed, 10 insertions(+) -- 2.1.4 diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index 62dc4f5..d2cfe07 100644 --- a/fs/Kconfig.binfmt +++ b/fs/Kconfig.binfmt @@ -36,6 +36,9 @@ config COMPAT_BINFMT_ELF config ARCH_BINFMT_ELF_STATE bool +config ARCH_USE_GNU_PROPERTY + bool + config BINFMT_ELF_FDPIC bool "Kernel support for FDPIC ELF binaries" default y if !BINFMT_ELF diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 34c02e4..a3eaad9 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -36,6 +36,7 @@ typedef __s64 Elf64_Sxword; #define PT_LOPROC 0x70000000 #define PT_HIPROC 0x7fffffff #define PT_GNU_EH_FRAME 0x6474e550 +#define PT_GNU_PROPERTY 0x6474e553 #define PT_GNU_STACK (PT_LOOS + 0x474e551) @@ -443,4 +444,10 @@ typedef struct elf64_note { Elf64_Word n_type; /* Content type */ } Elf64_Nhdr; +/* NT_GNU_PROPERTY_TYPE_0 header */ +struct gnu_property { + __u32 pr_type; + __u32 pr_datasz; +}; + #endif /* _UAPI_LINUX_ELF_H */