1. 04 Jun, 2014 1 commit
  2. 29 Apr, 2013 1 commit
  3. 23 Feb, 2013 1 commit
  4. 29 Nov, 2012 1 commit
  5. 05 Oct, 2012 1 commit
  6. 31 May, 2012 1 commit
  7. 21 Apr, 2012 1 commit
    • Linus Torvalds's avatar
      VM: add "vm_mmap()" helper function · 6be5ceb0
      Linus Torvalds authored
      
      This continues the theme started with vm_brk() and vm_munmap():
      vm_mmap() does the same thing as do_mmap(), but additionally does the
      required VM locking.
      
      This uninlines (and rewrites it to be clearer) do_mmap(), which sadly
      duplicates it in mm/mmap.c and mm/nommu.c.  But that way we don't have
      to export our internal do_mmap_pgoff() function.
      
      Some day we hopefully don't have to export do_mmap() either, if all
      modular users can become the simpler vm_mmap() instead.  We're actually
      very close to that already, with the notable exception of the (broken)
      use in i810, and a couple of stragglers in binfmt_elf.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6be5ceb0
  8. 28 Mar, 2012 1 commit
  9. 21 Mar, 2012 2 commits
  10. 29 Feb, 2012 1 commit
  11. 03 May, 2011 1 commit
  12. 31 Mar, 2011 1 commit
  13. 29 Jun, 2010 1 commit
    • Mike Frysinger's avatar
      flat: tweak default stack alignment · 2952095c
      Mike Frysinger authored
      The recent commit 1f0ce8b3
      
       ("mm: Move ARCH_SLAB_MINALIGN and
      ARCH_KMALLOC_MINALIGN to <linux/slab_def.h>") which moved the
      ARCH_SLAB_MINALIGN default into the global header inadvertently broke FLAT
      for a bunch of systems.  Blackfin systems now fail on any FLAT exec with:
      Unable to read code+data+bss, errno 14 When your /init is a FLAT binary,
      obviously this can be annoying ;).
      
      This stems from the alignment usage in the FLAT loader.  The behavior
      before was that FLAT would default to ARCH_SLAB_MINALIGN only if it was
      defined, and this was only defined by arches when they wanted a larger
      alignment value.  Otherwise it'd default to pointer alignment.  Arguably,
      this is kind of hokey that the FLAT is semi-abusing defines it shouldn't.
      
      So let's merge the two alignment requirements so the floor is never 0.
      Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
      Cc: David McCullough <davidm@snapgear.com>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: David Woodhouse <David.Woodhouse@intel.com>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2952095c
  14. 04 Jun, 2010 2 commits
  15. 21 Apr, 2010 1 commit
  16. 06 Mar, 2010 1 commit
  17. 29 Jan, 2010 1 commit
    • Linus Torvalds's avatar
      Split 'flush_old_exec' into two functions · 221af7f8
      Linus Torvalds authored
      
      'flush_old_exec()' is the point of no return when doing an execve(), and
      it is pretty badly misnamed.  It doesn't just flush the old executable
      environment, it also starts up the new one.
      
      Which is very inconvenient for things like setting up the new
      personality, because we want the new personality to affect the starting
      of the new environment, but at the same time we do _not_ want the new
      personality to take effect if flushing the old one fails.
      
      As a result, the x86-64 '32-bit' personality is actually done using this
      insane "I'm going to change the ABI, but I haven't done it yet" bit
      (TIF_ABI_PENDING), with SET_PERSONALITY() not actually setting the
      personality, but just the "pending" bit, so that "flush_thread()" can do
      the actual personality magic.
      
      This patch in no way changes any of that insanity, but it does split the
      'flush_old_exec()' function up into a preparatory part that can fail
      (still called flush_old_exec()), and a new part that will actually set
      up the new exec environment (setup_new_exec()).  All callers are changed
      to trivially comply with the new world order.
      Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      221af7f8
  18. 17 Dec, 2009 1 commit
  19. 24 Sep, 2009 1 commit
  20. 07 Aug, 2009 1 commit
  21. 29 May, 2009 1 commit
    • Oskar Schirmer's avatar
      flat: fix data sections alignment · c3dc5bec
      Oskar Schirmer authored
      
      The flat loader uses an architecture's flat_stack_align() to align the
      stack but assumes word-alignment is enough for the data sections.
      
      However, on the Xtensa S6000 we have registers up to 128bit width
      which can be used from userspace and therefor need userspace stack and
      data-section alignment of at least this size.
      
      This patch drops flat_stack_align() and uses the same alignment that
      is required for slab caches, ARCH_SLAB_MINALIGN, or wordsize if it's
      not defined by the architecture.
      
      It also fixes m32r which was obviously kaput, aligning an
      uninitialized stack entry instead of the stack pointer.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Bryan Wu <cooloney@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Signed-off-by: default avatarJohannes Weiner <jw@emlix.com>
      Acked-by: default avatarMike Frysinger <vapier.adi@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c3dc5bec
  22. 08 Jan, 2009 1 commit
  23. 13 Nov, 2008 1 commit
    • David Howells's avatar
      CRED: Make execve() take advantage of copy-on-write credentials · a6f76f23
      David Howells authored
      Make execve() take advantage of copy-on-write credentials, allowing it to set
      up the credentials in advance, and then commit the whole lot after the point
      of no return.
      
      This patch and the preceding patches have been tested with the LTP SELinux
      testsuite.
      
      This patch makes several logical sets of alteration:
      
       (1) execve().
      
           The credential bits from struct linux_binprm are, for the most part,
           replaced with a single credentials pointer (bprm->cred).  This means that
           all the creds can be calculated in advance and then applied at the point
           of no return with no possibility of failure.
      
           I would like to replace bprm->cap_effective with:
      
      	cap_isclear(bprm->cap_effective)
      
           but this seems impossible due to special behaviour for processes of pid 1
           (they always retain their parent's capability masks where normally they'd
           be changed - see cap_bprm_set_creds()).
      
           The following sequence of events now happens:
      
      ...
      a6f76f23
  24. 16 Oct, 2008 1 commit
  25. 11 Aug, 2008 1 commit
  26. 26 Jul, 2008 1 commit
    • Roland McGrath's avatar
      tracehook: exec · 6341c393
      Roland McGrath authored
      
      This moves all the ptrace hooks related to exec into tracehook.h inlines.
      
      This also lifts the calls for tracing out of the binfmt load_binary hooks
      into search_binary_handler() after it calls into the binfmt module.  This
      change has no effect, since all the binfmt modules' load_binary functions
      did the call at the end on success, and now search_binary_handler() does
      it immediately after return if successful.  We consolidate the repeated
      code, and binfmt modules no longer need to import ptrace_notify().
      Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Reviewed-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6341c393
  27. 06 Jun, 2008 1 commit
  28. 29 Apr, 2008 2 commits
    • Matt Helsley's avatar
      procfs task exe symlink · 925d1c40
      Matt Helsley authored
      
      The kernel implements readlink of /proc/pid/exe by getting the file from
      the first executable VMA.  Then the path to the file is reconstructed and
      reported as the result.
      
      Because of the VMA walk the code is slightly different on nommu systems.
      This patch avoids separate /proc/pid/exe code on nommu systems.  Instead of
      walking the VMAs to find the first executable file-backed VMA we store a
      reference to the exec'd file in the mm_struct.
      
      That reference would prevent the filesystem holding the executable file
      from being unmounted even after unmapping the VMAs.  So we track the number
      of VM_EXECUTABLE VMAs and drop the new reference when the last one is
      unmapped.  This avoids pinning the mounted filesystem.
      
      [akpm@linux-foundation.org: improve comments]
      [yamamoto@valinux.co.jp: fix dup_mmap]
      Signed-off-by: default avatarMatt Helsley <matthltc@us.ibm.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Cc: David Howells <dhowells@redhat.com>
      Cc:"Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: default avatarYAMAMOTO Takashi <yamamoto@valinux.co.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      925d1c40
    • Adrian Bunk's avatar
      make BINFMT_FLAT a bool · 3202e181
      Adrian Bunk authored
      
      I have not yet seen anyone saying he has a reasonable use case for using
      BINFMT_FLAT modular on his embedded device.
      
      Considering that fs/binfmt_flat.c even lacks a MODULE_LICENSE() I really doubt
      there is any, and this patch therefore makes BINFMT_FLAT a bool.
      Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
      Acked-by: default avatarBryan Wu <cooloney.lkml@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3202e181
  29. 15 Feb, 2008 1 commit
  30. 08 Feb, 2008 1 commit
  31. 17 Oct, 2007 2 commits
    • Andrew Morton's avatar
      binfmt_flat: warning fixes · 0e647c04
      Andrew Morton authored
      
      Fix this lot:
      
      fs/binfmt_flat.c: In function `decompress_exec':
      fs/binfmt_flat.c:293: warning: label `out' defined but not used
      fs/binfmt_flat.c: In function `load_flat_file':
      fs/binfmt_flat.c:462: warning: unsigned int format, long int arg (arg 3)
      fs/binfmt_flat.c:462: warning: unsigned int format, long int arg (arg 4)
      fs/binfmt_flat.c:518: warning: comparison of distinct pointer types lacks a cast
      fs/binfmt_flat.c:549: warning: passing arg 1 of `ksize' makes pointer from integer without a cast
      fs/binfmt_flat.c:601: warning: passing arg 1 of `ksize' makes pointer from integer without a cast
      fs/binfmt_flat.c: In function `load_flat_binary':
      fs/binfmt_flat.c:116: warning: 'dummy' might be used uninitialized in this function
      Acked-by: default avatarGreg Ungerer <gerg@uclinux.org>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0e647c04
    • Neil Horman's avatar
      core_pattern: ignore RLIMIT_CORE if core_pattern is a pipe · 7dc0b22e
      Neil Horman authored
      
      For some time /proc/sys/kernel/core_pattern has been able to set its output
      destination as a pipe, allowing a user space helper to receive and
      intellegently process a core.  This infrastructure however has some
      shortcommings which can be enhanced.  Specifically:
      
      1) The coredump code in the kernel should ignore RLIMIT_CORE limitation
         when core_pattern is a pipe, since file system resources are not being
         consumed in this case, unless the user application wishes to save the core,
         at which point the app is restricted by usual file system limits and
         restrictions.
      
      2) The core_pattern code should be able to parse and pass options to the
         user space helper as an argv array.  The real core limit of the uid of the
         crashing proces should also be passable to the user space helper (since it
         is overridden to zero when called).
      
      3) Some miscellaneous bugs need to be cleaned up (specifically the
         recognition of a recursive core dump, should the user mode helper itself
         crash.  Also, the core dump code in the kernel should not wait for the user
         mode helper to exit, since the same context is responsible for writing to
         the pipe, and a read of the pipe by the user mode helper will result in a
         deadlock.
      
      This patch:
      
      Remove the check of RLIMIT_CORE if core_pattern is a pipe.  In the event that
      core_pattern is a pipe, the entire core will be fed to the user mode helper.
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Cc: <martin.pitt@ubuntu.com>
      Cc: <wwoods@redhat.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7dc0b22e
  32. 03 Oct, 2007 2 commits
  33. 09 Jun, 2007 1 commit
  34. 09 Feb, 2007 1 commit
  35. 08 Dec, 2006 1 commit