-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
nuttx, at least w/o CONFIG_LIB_SYSCALL, calls user-specified signal hander within the "kernel" part of the code directly.
it isn't safe because user handler can call system calls.
in the extreme case, the user handler escapes with a longjmp. it likely crashes the kernel later.
unfortunately it's somehow common for apps for posix environment to use longjmp within a signal handler.
while CONFIG_LIB_SYSCALL seems to defer signal delivery as expected (i haven't tested this. just glancing the code)
it isn't always desirable because:
- it has considerable overhead like linking otherwise unused system calls
- you need to write arch-dependent code (eg. sim doesn't have an implementation right now)
i guess a lighter-weight fix is nicer to have. eg. making every syscall-type functions call, say,enter_kernel/leave_kernel.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels