incubator-nuttx/binfmt
Ville Juven 0ef735f93a binfmt/binfmt_execmodule: Copy filename if CONFIG_BUILD_KERNEL and argv=NULL
The 'filename' parameter comes from user space and cannot be accessed
after calling ret = addrenv_select(binp->addrenv, &binp->oldenv); as
it changes the address environment and 'filename' points to who knows
where. In this case, calling nxtask_init(filename...) will cause a crash.

Solve this by making a local copy before changing address environment IF
argv = NULL. Why ? Because argv[0] contains the process name in this case
and the argument vector is already copied into kernel memory, thus
passing argv[0] to nxtask_init(argv[0]...) is safe.
2023-09-16 14:41:52 +08:00
..
libelf binfmt: The program headers are optional. 2023-09-05 12:31:31 +08:00
libnxflat mm/alloc: remove all unnecessary cast for alloc 2023-08-30 14:34:20 +08:00
CMakeLists.txt Revert "Exec: Support run exec in current task" 2023-09-16 07:22:32 +03:00
Kconfig Fix Kconfig style 2023-09-13 21:39:49 +08:00
Makefile Revert "Exec: Support run exec in current task" 2023-09-16 07:22:32 +03:00
binfmt.h binfmt: Move [elf|nxflat]_[un]initialize to private header file 2023-07-10 23:03:17 +03:00
binfmt_copyargv.c mm/alloc: remove all unnecessary cast for alloc 2023-08-30 14:34:20 +08:00
binfmt_coredump.c elf/coredump: add support of dump task stack without memory segments 2023-05-24 22:34:47 +08:00
binfmt_dumpmodule.c sched/spawn: Support task_spawnattr_[set|get]stackaddr 2022-10-31 12:46:58 +09:00
binfmt_exec.c Revert "Exec: Support run exec in current task" 2023-09-16 07:22:32 +03:00
binfmt_execmodule.c binfmt/binfmt_execmodule: Copy filename if CONFIG_BUILD_KERNEL and argv=NULL 2023-09-16 14:41:52 +08:00
binfmt_execsymtab.c libc/symtab: Don't include symtab.h in the header files 2023-07-10 23:03:17 +03:00
binfmt_exit.c
binfmt_globals.c binfmt/elf: Fix the minor style issue 2023-08-27 18:46:40 -03:00
binfmt_initialize.c binfmt: Move [elf|nxflat]_[un]initialize to private header file 2023-07-10 23:03:17 +03:00
binfmt_loadmodule.c binfmt: remove sched_[un]lock 2023-07-26 09:43:51 -07:00
binfmt_register.c binfmt: remove sched_[un]lock 2023-07-26 09:43:51 -07:00
binfmt_unloadmodule.c binfmt/elf: Fix the minor style issue 2023-08-27 18:46:40 -03:00
binfmt_unregister.c binfmt: remove sched_[un]lock 2023-07-26 09:43:51 -07:00
builtin.c binfmt/elf: Fix the minor style issue 2023-08-27 18:46:40 -03:00
elf.c binfmt: ELF support load to LMA 2023-09-04 12:23:26 +08:00
nxflat.c binfmt/elf: Fix the minor style issue 2023-08-27 18:46:40 -03:00