nuttx/binfmt/libelf
fangxinyong 2d73e86b47 binfmt: support euid of process set from the file system
From posix spec, if set-user-ID bit is set in the file permissions,
then the effective user ID of the new process shall be set to the
user ID of the new process image file.
Let's ignore whether ST_NOSUID is set on the mounted file system.

https://pubs.opengroup.org/onlinepubs/007904875/functions/exec.html

test step:
hello example build as a module and call geteuid and getegid API.
then set file binary set-user-ID bit on the host.

$ chmod +s apps/bin/hello

nsh> mount -t hostfs -o fs=. /data
nsh> ls -l /data/apps/bin/hello
 -rwsrwsr-x    1000    1000    9264 /data/apps/bin/hello
nsh> /data/apps/bin/hello
geteuid:1000
getegid:1000

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-12 02:18:25 +08:00
..
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
gnu-elf.ld libelf: Support prioritized init and fini arrays. 2023-04-22 01:28:01 +08:00
Kconfig sched: Rename DEBUG_TCBINFO to ARCH_HAVE_TCBINFO 2023-07-26 09:33:38 +02:00
libelf_addrenv.c binfmt/elf: Support to load ET_EXEC in flat mode 2023-07-28 08:35:27 -07:00
libelf_bind.c binfmt: Move elf_allocbuffer to elf_sectname and elf_symname 2023-07-16 14:17:07 +03:00
libelf_coredump.c elf/coredump: alignment stack buffer to 64 to match gdb request 2023-05-30 23:00:23 +08:00
libelf_ctors.c binfmt: Move elf_allocbuffer to elf_sectname and elf_symname 2023-07-16 14:17:07 +03:00
libelf_dtors.c binfmt: Move elf_allocbuffer to elf_sectname and elf_symname 2023-07-16 14:17:07 +03:00
libelf_init.c binfmt: support euid of process set from the file system 2023-08-12 02:18:25 +08:00
libelf_iobuffer.c Author: Gregory Nutt: update licenses to Apache 2021-02-05 12:15:56 -03:00
libelf_load.c binfmt/elf: bss section should init to zero 2023-07-29 06:54:25 -07:00
libelf_read.c binfmt: Replace all nx_ API with file_ API 2021-07-06 11:18:13 +09:00
libelf_sections.c binfmt: Move elf_allocbuffer to elf_sectname and elf_symname 2023-07-16 14:17:07 +03:00
libelf_symbols.c binfmt: Move elf_allocbuffer to elf_sectname and elf_symname 2023-07-16 14:17:07 +03:00
libelf_uninit.c binfmt: Replace all nx_ API with file_ API 2021-07-06 11:18:13 +09:00
libelf_unload.c Author: Gregory Nutt: update licenses to Apache 2021-02-05 12:15:56 -03:00
libelf_verify.c elf: Replace {0x7f, 'E', 'L', 'F'} to EI_MAGIC 2023-07-06 09:15:50 -03:00
libelf.h Elf loader: give temporary write access to user .text memory 2022-05-03 21:25:25 +09:00
Make.defs binfmt: Move [elf|nxflat]_[un]initialize to private header file 2023-07-10 23:03:17 +03:00