public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: sfr@canb.auug.org.au, torvalds@linux-foundation.org
Cc: arnd@arndb.de, dhowells@redhat.com, alan@lxorguk.ukuu.org.uk,
	linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: [PATCH 03/17] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace
Date: Tue, 13 Dec 2011 10:03:59 +0000	[thread overview]
Message-ID: <1323770653-19177-4-git-send-email-dhowells@redhat.com> (raw)
In-Reply-To: <1323770653-19177-1-git-send-email-dhowells@redhat.com>

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 31f0508..999b4f5 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;
@@ -414,6 +405,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 [];
@@ -437,6 +435,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,
-- 
1.7.7.4

  parent reply	other threads:[~2011-12-13 10:03 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 10:03 [GIT PULL] User API split: Preliminary patches David Howells
2011-12-13 10:03 ` [PATCH 01/17] UAPI: Fix arch/mips/include/asm/Kbuild to have separate header-y lines David Howells
2011-12-13 10:03   ` David Howells
2011-12-13 10:03 ` [PATCH 02/17] UAPI: Don't include linux/compat.h in sparc's asm/siginfo.h David Howells
2011-12-13 10:03   ` David Howells
2011-12-13 18:32   ` David Miller
2011-12-13 10:03 ` David Howells [this message]
2011-12-13 10:03   ` [PATCH 03/17] UAPI: elf_read_implies_exec() is a kernel-only feature - so hide from userspace David Howells
2011-12-13 10:04 ` [PATCH 04/17] UAPI: Make MN10300 use asm-generic/param.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 05/17] UAPI: Make M32R " David Howells
2011-12-13 10:04 ` [PATCH 06/17] UAPI: Make FRV " David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 07/17] UAPI: Rearrange definition of HZ in asm-generic/param.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 08/17] UAPI: Guard linux/sound.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 09/17] UAPI: Guard linux/isdn_divertif.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 10/17] UAPI: Guard linux/pmu.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 11/17] UAPI: Guard linux/cuda.h David Howells
2011-12-13 10:04 ` [PATCH 12/17] UAPI: Alter the S390 asm include guards to be recognisable by the UAPI splitter David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 13/17] UAPI: Fix nested __KERNEL__ guards in video/edid.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 14/17] UAPI: Make linux/patchkey.h easier to parse David Howells
2011-12-13 12:57   ` Stephen Rothwell
2011-12-13 13:50     ` David Howells
2011-12-13 13:57       ` David Howells
2011-12-13 14:51         ` Stephen Rothwell
2011-12-13 10:04 ` [PATCH 15/17] UAPI: Fix AHZ multiple inclusion when __KERNEL__ is removed David Howells
2011-12-13 10:04 ` [PATCH 16/17] UAPI: Don't have a #elif clause in a __KERNEL__ guard in linux/soundcard.h David Howells
2011-12-13 10:04   ` David Howells
2011-12-13 10:04 ` [PATCH 17/17] UAPI: Split trivial #if defined(__KERNEL__) && X conditionals David Howells
2011-12-13 16:09 ` [GIT PULL] User API split: Preliminary patches David Howells
2011-12-13 16:26   ` Stephen Rothwell
2011-12-13 16:26     ` Stephen Rothwell

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=1323770653-19177-4-git-send-email-dhowells@redhat.com \
    --to=dhowells@redhat.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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