Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is possible to safely use the same handler for multiple signals, but doing so generally increases the likelihood of violating a rule which can result in a security vulnerability. For example, if a signal handler is constructed with the expectation that it will only be executed once, but it is registered to catch multiple signals, the handler may perform an operation multiple times that should only be performed once. Depending on what the handler does, this may provide a means to exploit other vulnerabilitiesThe delivered signal is masked and is not delivered until the registered signal handler exits. However, if this same handler is registered to handle a different signal, execution of the handler may be interrupted by this new signal. If a signal handler is constructed with the expectation that it cannot be interrupted, a vulnerability might exist. To eliminate this attack vector, each signal handler should only be registered to handle one type of signal.

...