From patchwork Fri Oct 18 17:25:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 176905 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1159877ill; Fri, 18 Oct 2019 10:27:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgSXqN4xfqOKYd4lemWjG0YbqYClteXjdM/C9EPcO8Seb6uEejIuAsZD+9j6/rV/ircSmv X-Received: by 2002:a17:906:e89:: with SMTP id p9mr9682762ejf.95.1571419624685; Fri, 18 Oct 2019 10:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571419624; cv=none; d=google.com; s=arc-20160816; b=lind9FnPMmA9h/Iuc3sn2rPA35ygOpcFpfdW0r/kCm6N+eFbDltLkeTuLAWD4OV/9C iE9TBW6VZjDtiGr+nfAqQLr6PJluBjkEVcaPAOyF9ipaE8bCOyTbyyx6UVNX7c25H0sO Hu4mjUGDHpzyl7flmeJ7qjoX65yvRKFPKTU5wUP4DOPhWBp1uEQohThpLkHJwn5V1Hhg nd/UZ3WwG9cF3bSeGMYpHx8WWgrBp9WiV3ex3V0dHv8K4KSkC75cIlijp1s1IdKHQdX8 kEJtV2xE2TtQdhThTEoNWtHzNDnyGZ/Wyc7k4mlFJ4YQjBY/LSbd5sXWkKjS/aXzSLxt e4SA== 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=h1OELDkwGd1w4niOSUXlEA8qH/RQVvaJTPGPuRFWwO0=; b=NfHobNqyfdlFAQGeUFZJasL2hPqiH8XK1so/NwJwjsiULWmwJ5uZuGQgPHjV6ohKco fIF85KNut8SIH3m5R0WX6p8j43EvZkR6XkkkstuoJpHttb0IEuK8HSPEpm/FBQKMfJ0o 67mt/TF4gs9glG+/R4lta9UW9L6wzgcmGBwtzyKzhlgXes8EIW2ti8IKcAAQjj/nTpMH LGhxM2LtURyMG5glCaCYdvDPaK6o3/DJkhBqQkXHGUvq088ZqpKsRCzDOSsKVtsO1rRY SmWcptQNTw0RiKDqrHzidpzqM8uV8SGDT4259uvOCdzTs+3Vw7oSnVBU6eefM2pMsonQ LtbA== 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 n8si3905057eju.311.2019.10.18.10.27.04; Fri, 18 Oct 2019 10:27:04 -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 S2410641AbfJRR1D (ORCPT + 26 others); Fri, 18 Oct 2019 13:27:03 -0400 Received: from [217.140.110.172] ([217.140.110.172]:46942 "EHLO foss.arm.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1729210AbfJRR1C (ORCPT ); Fri, 18 Oct 2019 13:27:02 -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 B59C2113E; Fri, 18 Oct 2019 10:26:37 -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 EA4613F718; Fri, 18 Oct 2019 10:26:34 -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?= , Marc Zyngier , 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 v3 01/12] ELF: UAPI and Kconfig additions for ELF program properties Date: Fri, 18 Oct 2019 18:25:34 +0100 Message-Id: <1571419545-20401-2-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1571419545-20401-1-git-send-email-Dave.Martin@arm.com> References: <1571419545-20401-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 --- fs/Kconfig.binfmt | 3 +++ include/linux/elf.h | 8 ++++++++ include/uapi/linux/elf.h | 1 + 3 files changed, 12 insertions(+) -- 2.1.4 Reviewed-by: Kees Cook 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)