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
gnu-elf.ld
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
libelf_coredump.c
libelf_ctors.c
libelf_dtors.c
libelf_init.c binfmt: support euid of process set from the file system 2023-08-12 02:18:25 +08:00
libelf_iobuffer.c
libelf_load.c binfmt/elf: bss section should init to zero 2023-07-29 06:54:25 -07:00
libelf_read.c
libelf_sections.c
libelf_symbols.c
libelf_uninit.c
libelf_unload.c
libelf_verify.c
libelf.h
Make.defs