Commit Graph

6 Commits

Author SHA1 Message Date
chao an
0f8ecc0150 libs/libc: export exit() if configured in flat mode
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-23 13:50:03 +08:00
Ville Juven
df1d7dd480 libc/exit: Purge calls to userspace API exit() from kernel
Remove calls to the userspace API exit() from the kernel. The problem
with doing such calls is that the exit functions are called with kernel
mode privileges which is a big security no-no.
2023-02-17 23:07:17 +08:00
Huang Qi
a66f0a6369 stdlib: Guard fflush in exit with CONFIG_FILE_STREAM
If CONFIG_FILE_STREAM disabled, fflush is a undefined function.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-02-12 00:09:29 +08:00
Xiang Xiao
bcd1ebf260 libc: Implement quick_exit and at_quick_exit
Defined by c11:
https://en.cppreference.com/w/c/program/quick_exit
https://en.cppreference.com/w/c/program/at_quick_exit

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-25 14:31:37 +02:00
Ville Juven
3be81e649f libc/stdio: Flush streams in userspace when process exits
This fixes a long standing issue, where the kernel does flushing of file
streams, although it should not handle such streams at all.
2022-12-22 20:16:11 +08:00
Ville Juven
622677d4a1 libc: Implement exit, atexit, on_exit and cxa_exit on the user side
For CONFIG_BUILD_KERNEL using the sched/task/task_exithook implementation
will just not work. It calls user code with kernel privileges which is
a bit of a security issue.
2022-05-25 15:28:43 +08:00