Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1374500ybf; Thu, 27 Feb 2020 09:44:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyJFMwx9RskjpQaijHJUTGsO5mHFZYcJ30eCoOk3/u4RgJqso7IVJZJ9khIxsEEIvAYm6d6 X-Received: by 2002:a9d:729c:: with SMTP id t28mr82676otj.66.1582825484759; Thu, 27 Feb 2020 09:44:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582825484; cv=none; d=google.com; s=arc-20160816; b=Vtpxbe2zN32KWKNnNiyXCUWviQzVxCysuioj98NZMX7BXsJM3WvFIjXRBjiXO5Shod CoLPffqnUo7Dpa8pQpdDunyKqdMYRoQF6WT6Ea2HL1n7RaMD1i0rhj+V4CuHVgTKGc5F i8mIKhlm91d76oG+Ov9V7wpBLuFnZrA5SGqkMWB4yWCUmM4FyxZisZ5IQtL4gHxL4c3e WKVD3U6jObhIcJdMMSR04tFQ7eq110ByaTG9/JQLB7qAo9fLW0IqQ9uY5D9l4N/NxfRW KutcPDx34EUvhHvZ2uMLbW+EaE5iSgtmr5DDOZAWms3SKLKLe3zjKked0mFBgrGqCbuC fOOg== 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=0YDD44E0ZBOpPZBRyJz96bDFGn8UsbAhXEcOVc/4s9Bve2G4aE3U1Cqln9VJlhCqfE C6eRLxDnUZ5ZOi+I7VG5vOK0BNv+YW4y5fjPUW+RObiNeTJWDXklvyoVjBFoOaErgaXH kn5S2fE5l99ZZVDyi1xtrNcFyDKX5FIeJnau+R/eM+RrXWEILiKiMJUlh16WoDooBj5m JOrX+oTJdWXo3C/yWqlHNno8DSuuN1nwdwLjZUhVkXWP5PAqNlpfK4WCGkoJpWXDZzWf BpBXa04p/Effsfc56etG+0mbCjGr6YgHHcn7pYrfbVuoVYarzZBQafbQHkOourjQez2L ukZw== 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 o4si2145549otp.200.2020.02.27.09.44.32; Thu, 27 Feb 2020 09:44:44 -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 S1730391AbgB0RoY (ORCPT + 99 others); Thu, 27 Feb 2020 12:44:24 -0500 Received: from foss.arm.com ([217.140.110.172]:55442 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727053AbgB0RoX (ORCPT ); Thu, 27 Feb 2020 12:44:23 -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 0353C30E; Thu, 27 Feb 2020 09:44:23 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 45FA23F73B; Thu, 27 Feb 2020 09:44: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 v8 01/11] ELF: UAPI and Kconfig additions for ELF program properties Date: Thu, 27 Feb 2020 17:44:07 +0000 Message-Id: <20200227174417.23722-2-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200227174417.23722-1-broonie@kernel.org> References: <20200227174417.23722-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