From patchwork Thu Oct 10 18:44:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 175814 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2683038ill; Thu, 10 Oct 2019 11:45:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5hNlmxWuCQgVxSIPWbkyTtlS6D+L+pkJHOUm+/Fa7RkO4Ld1uWlpMrE3r5qGVQoQZkoYW X-Received: by 2002:a05:6402:1817:: with SMTP id g23mr9601706edy.26.1570733135240; Thu, 10 Oct 2019 11:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570733135; cv=none; d=google.com; s=arc-20160816; b=QUP0vg0HYp8JAzorwgeqWiV7kOlPqTnxCC+CoOkVB8BIzc60xqhmYSiKNQsUsPHfiD pjy4TvwPUwv+XBkZDRIQIXA3Z2A0LVi38QS2Ctx9v33NEALq2Sw3aBSmNW+w4DXBJUrl MK5thVHyKsMHfMJZuiaSx1fAkkFfCTh6Z5ACnq9sTjEWF1maMPBJltmBrPQ6XUvOOeNF V4TuauGq43jTsQC949Q58WtS5c8m2pZVhBM0xjiMhAHoJFjoFsxNkeJrg/YS9rUt0GIy xXSYvbyqhBNMa0GGvDU8BwYdIY+faMyrEeYyAOfdY4tO96pup3iYvPZdeEGmYKdkA9yN PHjA== 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=ANN5cN195MmjwES4H0We2PeazLTk3q9fFcaZMS1XNFQ=; b=VpNIv3vLeW1QbIpwbHre5Yx6BKrw2j4YBnMFfBYK/LAOY+D+XJpZ5QZ3o0zjhJxhHZ Bq8axeDFTRj1Bkf1ioq76N62kGMKtI0fzAjjq2+qbZUd8daAiyUA6OBmaqv0aDo9/Nc3 SMh3Mm7CFmohcgqchi2I2EuTswuS4pjcqyGcXfURA7P8+2qTsc5TwzFr355b5lTyLlMj w6EvWx64mlYYbqiD+yr9uivl9ReUAtFXr5ESYHv9ptnUa+P6v773PvQqKxvT16sz1tCd FJqQqrpwdG0wGfE1MYozLfrSrTSuk4sAOvfCLlR/2LGo8SeWYKi4hI3Hitllw8BY1AD/ WsEw== 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 v6si3576260edw.51.2019.10.10.11.45.35; Thu, 10 Oct 2019 11:45:35 -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 S1727131AbfJJSpd (ORCPT + 22 others); Thu, 10 Oct 2019 14:45:33 -0400 Received: from foss.arm.com ([217.140.110.172]:38286 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726424AbfJJSpd (ORCPT ); Thu, 10 Oct 2019 14:45:33 -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 9494328; Thu, 10 Oct 2019 11:45:32 -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 E54C13F703; Thu, 10 Oct 2019 11:45:29 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Andrew Jones , Arnd Bergmann , Catalin Marinas , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Kees Cook , =?utf-8?q?Kristina_Mart=C5=A1enko?= , Mark Brown , Paul Elliott , Peter Zijlstra , Richard Henderson , Sudakshina Das , Szabolcs Nagy , Thomas Gleixner , Will Deacon , Yu-cheng Yu , Amit Kachhap , Vincenzo Frascino , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 01/12] ELF: UAPI and Kconfig additions for ELF program properties Date: Thu, 10 Oct 2019 19:44:29 +0100 Message-Id: <1570733080-21015-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1570733080-21015-1-git-send-email-Dave.Martin@arm.com> References: <1570733080-21015-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 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 --- Changes since RFC v2: * Fix struct gnu_property indentation to follow the linux coding style --- fs/Kconfig.binfmt | 3 +++ include/linux/elf.h | 8 ++++++++ include/uapi/linux/elf.h | 1 + 3 files changed, 12 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/linux/elf.h b/include/linux/elf.h index e3649b3..459cddc 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,11 @@ 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 */ +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 34c02e4..c377314 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)