You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "yamt (via GitHub)" <gi...@apache.org> on 2023/08/21 07:41:56 UTC

[GitHub] [nuttx] yamt opened a new issue, #10326: signal handler is called within "kernel"

yamt opened a new issue, #10326:
URL: https://github.com/apache/nuttx/issues/10326

   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`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org