linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: linux-arch@vger.kernel.org
Cc: dhowells@redhat.com
Subject: [PATCH 13/35] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace
Date: Sat, 02 Jul 2011 12:09:27 +0100	[thread overview]
Message-ID: <20110702110927.21948.8187.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20110702110716.21948.74214.stgit@warthog.procyon.org.uk>

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 <dhowells@redhat.com>
---

 include/linux/elf.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

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 <asm/elf.h>
 #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,

  parent reply	other threads:[~2011-07-02 11:09 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-02 11:07 [PATCH 00/35] UAPI header file split David Howells
2011-07-02 11:07 ` [PATCH 01/35] UAPI: Convert #include "..." to #include <path/...> in kernel system headers David Howells
2011-07-02 11:08 ` [PATCH 03/35] UAPI: Add uapi/ include directory to build David Howells
2011-07-02 11:08 ` [PATCH 04/35] UAPI: Differentiate userspace build and kernelspace build include path sets David Howells
2011-07-02 11:08 ` [PATCH 05/35] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed David Howells
2011-07-02 11:08 ` [PATCH 06/35] UAPI: ac_etime in linux/acct.h must keep its __KERNEL__ guards David Howells
2011-07-02 11:08 ` [PATCH 07/35] UAPI: Make linux/patchkey.h easier to parse David Howells
2011-07-02 11:08 ` [PATCH 08/35] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h David Howells
2011-07-02 11:08 ` [PATCH 09/35] UAPI: Fix nested __KERNEL__ guards in video/edid.h David Howells
2011-07-02 11:09 ` [PATCH 10/35] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals David Howells
2011-07-02 11:09 ` [PATCH 11/35] UAPI: Remove the inclusion of linux/types.h from x86's asm/page.h David Howells
2011-07-02 11:09 ` [PATCH 12/35] UAPI: Fix definition of HZ in asm-generic/param.h David Howells
2011-07-02 11:09 ` David Howells [this message]
2011-07-02 11:09 ` [PATCH 14/35] UAPI: Fix sigset_t ordering problem David Howells
2011-07-02 11:09 ` [PATCH 15/35] UAPI: Fix E820_X_MAX " David Howells
2011-07-02 11:09 ` [PATCH 16/35] UAPI: Fix linux/netfilter.h inclusion order David Howells
2011-07-02 11:10 ` [PATCH 17/35] UAPI: Fix linux/input.h " David Howells
2011-07-02 11:10 ` [PATCH 18/35] UAPI: Fix up linux/netfilter/xt_policy.h David Howells
2011-07-02 11:10 ` [PATCH 19/35] UAPI: Fix linux/auto_fs.h inclusion order David Howells
2011-07-02 11:10 ` [PATCH 20/35] UAPI: Fix drmP.h to use #include <...> when referring to system header files David Howells
2011-07-02 11:10 ` [PATCH 21/35] UAPI: sound/sound_core.c should include linux/fs.h David Howells
2011-07-02 11:10 ` [PATCH 22/35] UAPI: Fix SNDRV_*_ENDIAN ordering problem David Howells
2011-07-02 11:10 ` [PATCH 23/35] UAPI: Fix u_quad_t ordering problem in linux/coda.h David Howells
2011-07-02 11:11 ` [PATCH 24/35] UAPI: Fix linux/coda.h David Howells
2011-07-02 11:11 ` [PATCH 25/35] UAPI: Guard linux/isdn_divertif.h David Howells
2011-07-02 11:11 ` [PATCH 26/35] UAPI: Guard linux/sound.h David Howells
2011-07-02 11:11 ` [PATCH 27/35] UAPI: Fix linux/ncp.h David Howells
2011-07-02 11:11 ` [PATCH 28/35] UAPI: Fix x86_64 system call count and generation David Howells
2011-07-02 11:11 ` [PATCH 29/35] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines David Howells
2011-07-02 11:12 ` [PATCH 31/35] UAPI: Plumb the UAPI Kbuilds into the user header handling system David Howells
2011-07-02 11:12 ` [PATCH 32/35] UAPI: Set up uapi/asm/Kbuild.asm David Howells
2011-07-02 11:12 ` [PATCH 33/35] UAPI: Move linux/version.h David Howells
2011-07-02 11:12 ` [PATCH 34/35] UAPI: Make UAPI headers install to usr/include/ David Howells
2011-07-02 11:12 ` [PATCH 35/35] UAPI: Fix the page-types query program in the docs David Howells
2011-07-02 11:33 ` [PATCH 00/35] UAPI header file split - scripts David Howells
2011-07-05 20:46 ` [PATCH 00/35] UAPI header file split Randy Dunlap
2011-07-06 11:04 ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110702110927.21948.8187.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).