Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp10731ybf; Wed, 26 Feb 2020 07:57:45 -0800 (PST) X-Google-Smtp-Source: APXvYqxpyTMkkKzTgFSJxz8G/vlGcAsl3BY7FK+QOFtrlUPv24mHjj6vqVtC0UZB0vlCzEV9vCS7 X-Received: by 2002:a9d:22:: with SMTP id 31mr3422828ota.173.1582732665799; Wed, 26 Feb 2020 07:57:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582732665; cv=none; d=google.com; s=arc-20160816; b=FG5SVzUFQo+f7o8zWelLCJKKf8eZy3oRPWerE5u/K15yJncMmkuVL8r+WQDuncKIQV 9tAhy5gRt/kQED4DpQTvX7R1UuRoq0qSXRJ43dtP+wvTxlUa6Nkc0ViVeJw3GxqZ2CGX x+LNKDnlbSiCP/N9pfbZqW95oy2WQQGb/quGwA/C9TAJ2zFDuNl5cABqfQ2eDanbRD+R 9hqxwsCEssyV9FjaJTVa/fgYFvtHIMzM8QAUp5CDnQVmBtO+g90xl9nqxZZ0hr0t9/Bc nFv7Ow2yfIPyiM6knMToEBUczLSTZT2iJW6r8TkKVrLZmUntU1cTBCTzNQ8ghbiv1ioR 2v5Q== 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=izTPGcNLz8LWh+QwXtaeQ+lr+HZCqVmgyoZnyPtRTgBBQhcgiPK1J6/XbXdQG8ic1v lBkxs4vOKH4ARyPDLc5vfAJ5e8noQNzN+OSMrGjdvW5A0b+slRZH7mkhY3EAnKvvUFLP NgDsUbt3XUHYs9yIyeIHY+JYlmu7kEk+DwagPWuALmHm0JWVAGqfuus48mtHeTaxOL0h VtyPjPKub+okkDqjYMdq3/4DqyVHW708oA7NMIUWELB45s8OJaepzrlyWkxpHeuS+0Pb vUxr8m8nCEz9F1vvBQancnnQZNuZj43U3JVXy9c8f/6C3z2lI7cwP0nNP8/Ib6pzKl9s MzNQ== 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 j9si1474358oiw.133.2020.02.26.07.57.34; Wed, 26 Feb 2020 07:57:45 -0800 (PST) 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 S1728692AbgBZP5Z (ORCPT + 99 others); Wed, 26 Feb 2020 10:57:25 -0500 Received: from foss.arm.com ([217.140.110.172]:37938 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728590AbgBZP5Y (ORCPT ); Wed, 26 Feb 2020 10:57:24 -0500 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 A684331B; Wed, 26 Feb 2020 07:57:23 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E628C3F819; Wed, 26 Feb 2020 07:57:22 -0800 (PST) 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 v7 01/11] ELF: UAPI and Kconfig additions for ELF program properties Date: Wed, 26 Feb 2020 15:57:04 +0000 Message-Id: <20200226155714.43937-2-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226155714.43937-1-broonie@kernel.org> References: <20200226155714.43937-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