-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libc: Implement userland implementations of exit functions #6197
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
bec0dea
to
3de7365
Compare
6da361a
to
937cfc9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
@pussuw there seem to be some warnings:
CI turns warnings into errors, I don't know if you do that too, but you can with: (there are some |
This comment was marked as resolved.
This comment was marked as resolved.
It could be a parallel make issue as it seemed that the dependencies were messed up. I took a quick look at |
@pussuw Apparently we have a name collision with https://github.com/apache/incubator-nuttx/blob/master/libs/libc/stdlib/lib_Exit.c and your newly created file |
@Ouss4 thanks for doing the investigation! That makes sense then, since I don't get the error but I'm on Linux in which file names are case sensitive. I'll merge the two files, makes no sense to have two. |
This comment was marked as resolved.
This comment was marked as resolved.
5939b55
to
968d200
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
dfb1b2e
to
4f79869
Compare
This comment was marked as resolved.
This comment was marked as resolved.
I still think that we are missing |
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.
Remove the kernel side implementations altogether. These will be replaced by user land implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and great work!
Thanks for the review, turned into quite a magnus opus in the end. |
I noticed that the ostest with esp32-devkitc:smp (real board not qemu) causes a deadlock.
|
@masayuki2009 did you enable any other option? Actually, I've been using the latest master the whole day for some tests. |
No
Hmm, I confirmed that the latest upstream works. |
Yes, it's strange. #6286 could improve the performance which may reduce the race condition. |
It has been removed a few years ago. apache/nuttx#6197
It has been removed a few years ago. apache/nuttx#6197
It has been removed a few years ago. apache/nuttx#6197
It has been removed a few years ago. apache/nuttx#6197
It has been removed a few years ago. apache/nuttx#6197
Summary
Implement atexit(), on_exit(), exit() to libc. Using the call gate versions is problematic as they basically inject userland code into the kernel, which is then run with kernel privileges. In any case the functions belong to libc.
Impact
Exit functions are executed with user privileges
Testing
mpfs icicle:knsh