linux/arch/parisc/hpux
Linus Torvalds c4ad8f98be execve: use 'struct filename *' for executable name passing
This changes 'do_execve()' to get the executable name as a 'struct
filename', and to free it when it is done.  This is what the normal
users want, and it simplifies and streamlines their error handling.

The controlled lifetime of the executable name also fixes a
use-after-free problem with the trace_sched_process_exec tracepoint: the
lifetime of the passed-in string for kernel users was not at all
obvious, and the user-mode helper code used UMH_WAIT_EXEC to serialize
the pathname allocation lifetime with the execve() having finished,
which in turn meant that the trace point that happened after
mm_release() of the old process VM ended up using already free'd memory.

To solve the kernel string lifetime issue, this simply introduces
"getname_kernel()" that works like the normal user-space getname()
function, except with the source coming from kernel memory.

As Oleg points out, this also means that we could drop the tcomm[] array
from 'struct linux_binprm', since the pathname lifetime now covers
setup_new_exec().  That would be a separate cleanup.

Reported-by: Igor Zhbanov <i.zhbanov@samsung.com>
Tested-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-02-05 12:54:53 -08:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
entry_hpux.S [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code 2007-02-17 01:17:42 -05:00
fs.c execve: use 'struct filename *' for executable name passing 2014-02-05 12:54:53 -08:00
gate.S parisc: fix double restarts 2012-10-01 09:58:13 -04:00
ioctl.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
sys_hpux.c vfs: new helper - vfs_ustat() 2012-01-03 22:53:07 -05:00
wrappers.S Revert "parisc: fix trivial section name warnings" 2008-06-13 10:49:45 -04:00