sched/assert: Re-implement assert() into user space

_assert is a kernel procedure, entered via system call to make the core
dump in privileged mode.

Running exit() from this context is not OK as it runs the registered
exit functions and flushes streams, which must not be done
from privileged mode as it is a security hole.

Thus, implement assert() into user space (again) and remove the exit()
call from the kernel procedure.
This commit is contained in:
Ville Juven
2022-12-22 12:21:56 +02:00
committed by Xiang Xiao
parent b0b352f784
commit 172b209f2d
5 changed files with 63 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
"_exit","unistd.h","","noreturn","int"
"_assert","assert.h","","noreturn","FAR const char *","int"
"_assert","assert.h","","void","FAR const char *","int"
"accept","sys/socket.h","defined(CONFIG_NET)","int","int","FAR struct sockaddr *","FAR socklen_t *"
"adjtime","sys/time.h","defined(CONFIG_CLOCK_TIMEKEEPING)","int","FAR const struct timeval *","FAR struct timeval *"
"aio_cancel","aio.h","defined(CONFIG_FS_AIO)","int","int","FAR struct aiocb *"
1 _exit unistd.h noreturn int
2 _assert assert.h noreturn void FAR const char *
3 accept sys/socket.h defined(CONFIG_NET) int int
4 adjtime sys/time.h defined(CONFIG_CLOCK_TIMEKEEPING) int FAR const struct timeval *
5 aio_cancel aio.h defined(CONFIG_FS_AIO) int int