1. 01 Oct, 2012 37 commits
  2. 30 Sep, 2012 3 commits
    • Al Viro's avatar
      generic kernel_execve() · 282124d1
      Al Viro authored
      based mostly on arm and alpha versions.  Architectures can define
      __ARCH_WANT_KERNEL_EXECVE and use it, provided that
      	* they have working current_pt_regs(), even for kernel threads.
      	* kernel_thread-spawned threads do have space for pt_regs
      in the normal location.  Normally that's as simple as switching to
      generic kernel_thread() and making sure that kernel threads do *not*
      go through return from syscall path; call the payload from equivalent
      of ret_from_fork if we are in a kernel thread (or just have separate
      ret_from_kernel_thread and make copy_thread() use it instead of
      ret_from_fork in kernel thread case).
      	* they have ret_from_kernel_execve(); it is called after
      successful do_execve() done by kernel_execve() and gets normal
      pt_regs location passed to it as argument.  It's essentially
      a longjmp() analog - it should set sp, etc. to the situation
      expected at the return for syscall and go there.  Eventually
      the need for that sucker will disappear, but that'll take some
      surgery on kernel_thread() payloads.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      282124d1
    • Al Viro's avatar
      new helper: current_pt_regs() · a3460a59
      Al Viro authored
      Normally (and that's the default) it's just task_pt_regs(current).
      However, if an architecture can optimize that, it can do so by
      making a macro of its own available from asm/ptrace.h.  More
      importantly, some architectures have task_pt_regs() working only
      for traced tasks blocked on signal delivery.  current_pt_regs()
      needs to work for *all* processes, so before those architectures
      start using stuff relying on current_pt_regs() they'll need a
      properly working variant.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a3460a59
    • Al Viro's avatar
      preparation for generic kernel_thread() · 2aa3a7f8
      Al Viro authored
      Let architectures select GENERIC_KERNEL_THREAD and have their copy_thread()
      treat NULL regs as "it came from kernel_thread(), sp argument contains
      the function new thread will be calling and stack_size - the argument for
      that function".  Switching the architectures begins shortly...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      2aa3a7f8