incubator-nuttx/binfmt
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
..
libelf binfmt: support euid of process set from the file system 2023-08-12 02:18:25 +08:00
libnxflat binfmt: Move [elf|nxflat]_[un]initialize to private header file 2023-07-10 23:03:17 +03:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig binfmt: Change the default of BINFMT_DISABLE to DEFAULT_SMALL 2023-08-10 11:35:41 +03:00
Makefile binfmt: Move [elf|nxflat]_[un]initialize to private header file 2023-07-10 23:03:17 +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 binfmt: Let binfmt_copyargv return error code 2022-10-19 08:22:56 +09: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 binfmt: add enter_critical_section 2023-08-10 20:46:59 +08:00
binfmt_execmodule.c binfmt: support euid of process set from the file system 2023-08-12 02:18:25 +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_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 sched/addrenv: Remove up_addrenv_restore 2023-02-08 02:51:23 +08:00
binfmt_unregister.c binfmt: remove sched_[un]lock 2023-07-26 09:43:51 -07:00
builtin.c
elf.c binfmt: support euid of process set from the file system 2023-08-12 02:18:25 +08:00
nxflat.c Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00