From patchwork Thu Jul 28 15:51:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 1016162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6SFqRTj019235 for ; Thu, 28 Jul 2011 15:52:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755796Ab1G1Pvz (ORCPT ); Thu, 28 Jul 2011 11:51:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59621 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755791Ab1G1Pvx (ORCPT ); Thu, 28 Jul 2011 11:51:53 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6SFppFY001429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 28 Jul 2011 11:51:51 -0400 Received: from warthog.procyon.org.uk ([10.3.112.8]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6SFplwk016567; Thu, 28 Jul 2011 11:51:48 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells Subject: [PATCH 15/40] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace [ver #3] To: torvalds@osdl.org Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, David Howells Date: Thu, 28 Jul 2011 16:51:47 +0100 Message-ID: <20110728155146.16618.91167.stgit@warthog.procyon.org.uk> In-Reply-To: <20110728154920.16618.89358.stgit@warthog.procyon.org.uk> References: <20110728154920.16618.89358.stgit@warthog.procyon.org.uk> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 28 Jul 2011 15:52:28 +0000 (UTC) elf_read_implies_exec() is a kernel-only feature as the second parameter is a constant that isn't exported to userspace. Not only that, but the arch-specific overrides are not exported either. So hide the macro from userspace. Similarly, struct file should not be predeclared in userspace. Signed-off-by: David Howells --- include/linux/elf.h | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/elf.h b/include/linux/elf.h index 110821c..411d7b8 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h @@ -7,15 +7,6 @@ #include #endif -struct file; - -#ifndef elf_read_implies_exec - /* Executables for which elf_read_implies_exec() returns TRUE will - have the READ_IMPLIES_EXEC personality flag set automatically. - Override in asm/elf.h as needed. */ -# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 -#endif - /* 32-bit ELF base types. */ typedef __u32 Elf32_Addr; typedef __u16 Elf32_Half; @@ -413,6 +404,13 @@ typedef struct elf64_note { } Elf64_Nhdr; #ifdef __KERNEL__ +#ifndef elf_read_implies_exec + /* Executables for which elf_read_implies_exec() returns TRUE will + have the READ_IMPLIES_EXEC personality flag set automatically. + Override in asm/elf.h as needed. */ +# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0 +#endif + #if ELF_CLASS == ELFCLASS32 extern Elf32_Dyn _DYNAMIC []; @@ -436,6 +434,8 @@ extern Elf64_Dyn _DYNAMIC []; #endif /* Optional callbacks to write extra ELF notes. */ +struct file; + #ifndef ARCH_HAVE_EXTRA_ELF_NOTES static inline int elf_coredump_extra_notes_size(void) { return 0; } static inline int elf_coredump_extra_notes_write(struct file *file,