C and C++ Binaries


BADFUNC.SIGNAL : Use of signal

Summary

A use of signal(), which requires that certain precautions be taken.

Properties

Class Name Use of signal
Significance security
Mnemonic BADFUNC.SIGNAL
Categories
AUTOSARC++14 AUTOSARC++14:M18-7-1 The signal handling facilities of <csignal> shall not be used.
MisraC++2008 MisraC++2008:18-7-1 The signal handling facilities of <csignal> shall not be used.
MisraC++2023 MisraC++2023:21.10.3 The facilities provided by the standard header file <csignal> shall not be used
CWE CWE:676 Use of Potentially Dangerous Function
TS17961 TS17961:5.3-accsig 5.3. Accessing shared objects in signal handlers
  TS17961:5.5-asyncsig 5.5. Calling functions in the C Standard Library other than abort, _Exit, and signal from within a signal handler
  TS17961:5.7-sigcall 5.7. Calling signal from interruptible signal handlers
CERT-C CERT-C:CON37-C Do not call signal() in a multithreaded program
  CERT-C:SIG00-C Mask signals handled by noninterruptible signal handlers
  CERT-C:SIG01-C Understand implementation-specific details regarding signal handler persistence
  CERT-C:SIG02-C Avoid using signals to implement normal functionality
  CERT-C:SIG30-C Call only asynchronous-safe functions within signal handlers
  CERT-C:SIG34-C Do not call signal() from within interruptible signal handlers
BSI BSI:SIGNAL-01 Use of signal
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Use of signal"
To enable all BSI-related classes, including all BSI-specific BADFUNC classes, use the bsi configuration preset.

Resolution

Avoid the use of signals.

Alternatively, when you see a Use of signal warning, make sure that you have taken steps to eliminate overlap between signal handler calls (including multiple calls to the same signal handler), ensure that signals are not running at a higher privilege level than necessary, and warn the developer when signals occur (including information about the signal handler). If so, you can change the warning state to Suppressed.

Relevant Configuration File Parameters

This class is implemented using a BAD_FUNCTION_* rule set in the general template configuration file.

The following configuration file parameters affect checks for this warning class.