Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2795728ybh; Mon, 16 Mar 2020 09:51:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtiqRgqAa5UyPESk5TsOBl+NUr0rS9hRvC81uVOEvbjb9R56JQIgdA6vZY3kWdqmRXEOEtq X-Received: by 2002:aca:4997:: with SMTP id w145mr372223oia.58.1584377499139; Mon, 16 Mar 2020 09:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584377499; cv=none; d=google.com; s=arc-20160816; b=H0vCjIkoxfstDZIMDWM4b1mb8g2E9qSrjtEr9d6tM2QUh9VuEzZoVBhl3o2r27d8jd 9p89+mvLBwioNmTH4Ml9vZeCgQzUCDWk+hJAzcLMRBgs+Yav4fhohWVMpPewcqGsDSE3 ImIVwjQFdAEnlnopDvEDuNo8pXUy4FP2Ns1ERMx1rDR/notDhI2Ivt9OuvS2bUdst4qD +Yugj+S06HmXIPVtOv2Q5EBel9ammmcL5SAKR+scXvRHK/BzrLxFmxv9LdvnAAB+Rfih MGerKstfehLm8ManTn3AguflMJUy5HbmKEzJCttpAha/ClARHnFrtC83DqYlubPkvpxi 0xoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=RfHkQT+Q6WF7Sqo9zpPZJfJvRNjFeVSpJnfcM7lUErA=; b=lbjv/cJbTL6suh7eI8unGkjO4aB5udn+A5WORmHxwnD5tAk0Ww/N4ufvwMwMTMcKHB RUIVhA7XekpW4ZFMNHTGS9JMwtlLgRh33rb2Q145rMfY7JVrwSrwN7POSLHCzPaWcCyM 366EQIg8YrA8uA6gj4gNSLpQqnHFkfzKPD3OFmMRBtd92LX+YIBSob7qzYrKb5WF72Qm nI64cc5Na/kMsh98DtjoLXMy0DK1dRceYfSIPXsnAJn+HEu68v7JYatMCspEhmJRH2jK 9yC8+sIxoBDv+T2o5FR5m4JLabsWjMYOUyM7Rq5vW9fVnkmf+K5XpvVFUnPB1q3DNiiB 99fA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si217562ota.160.2020.03.16.09.51.26; Mon, 16 Mar 2020 09:51:39 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732163AbgCPQvE (ORCPT + 99 others); Mon, 16 Mar 2020 12:51:04 -0400 Received: from foss.arm.com ([217.140.110.172]:52052 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731414AbgCPQvB (ORCPT ); Mon, 16 Mar 2020 12:51:01 -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 02FB3101E; Mon, 16 Mar 2020 09:51:01 -0700 (PDT) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 796313F67D; Mon, 16 Mar 2020 09:51:00 -0700 (PDT) From: Mark Brown To: Catalin Marinas , Will Deacon Cc: Alexander Viro , Paul Elliott , Peter Zijlstra , Yu-cheng Yu , Amit Kachhap , Vincenzo Frascino , Marc Zyngier , Eugene Syromiatnikov , Szabolcs Nagy , "H . J . Lu " , Andrew Jones , Kees Cook , Arnd Bergmann , Jann Horn , Richard Henderson , =?UTF-8?q?Kristina=20Mart=C5=A1enko?= , Thomas Gleixner , Florian Weimer , Sudakshina Das , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dave Martin , Mark Brown Subject: [PATCH v10 01/13] ELF: UAPI and Kconfig additions for ELF program properties Date: Mon, 16 Mar 2020 16:50:43 +0000 Message-Id: <20200316165055.31179-2-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316165055.31179-1-broonie@kernel.org> References: <20200316165055.31179-1-broonie@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Martin Pull the basic ELF definitions relating to the NT_GNU_PROPERTY_TYPE_0 note from Yu-Cheng Yu's earlier x86 shstk series. Signed-off-by: Yu-cheng Yu Signed-off-by: Dave Martin Reviewed-by: Kees Cook Reviewed-by: Catalin Marinas Signed-off-by: Mark Brown --- fs/Kconfig.binfmt | 3 +++ include/linux/elf.h | 12 ++++++++++++ include/uapi/linux/elf.h | 1 + 3 files changed, 16 insertions(+) diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt index 62dc4f577ba1..d2cfe0729a73 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/linux/elf.h b/include/linux/elf.h index e3649b3e970e..f7b24c5fcfb6 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -2,6 +2,7 @@ #ifndef _LINUX_ELF_H #define _LINUX_ELF_H +#include #include #include @@ -56,4 +57,15 @@ static inline int elf_coredump_extra_notes_write(struct coredump_params *cprm) { extern int elf_coredump_extra_notes_size(void); extern int elf_coredump_extra_notes_write(struct coredump_params *cprm); #endif + +/* + * NT_GNU_PROPERTY_TYPE_0 header: + * Keep this internal until/unless there is an agreed UAPI definition. + * pr_type values (GNU_PROPERTY_*) are public and defined in the UAPI header. + */ +struct gnu_property { + u32 pr_type; + u32 pr_datasz; +}; + #endif /* _LINUX_ELF_H */ diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index 34c02e4290fe..c37731407074 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) -- 2.20.1