JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++
Binaries


BADFUNC.SIGNAL : signalの使用

要旨

特定の予防措置をとることが必要とされる signal() を使用しています。

プロパティ

クラス名 Use of signal
日本語クラス名 signalの使用
クラス分類 セキュリティ (security)
ニーモニック BADFUNC.SIGNAL
カテゴリー
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 Accessing shared objects in signal handlers
  TS17961:5.5-asyncsig Calling functions in the C Standard Library other than abort, _Exit, and signal from within a signal handler
  TS17961:5.7-sigcall 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
OWASP-2021 OWASP-2021:A4 Insecure design
OWASP-2025 OWASP-2025:A06 Insecure Design
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで無効になっています。チェックを有効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += allow class="Use of signal"
全ての BSI 固有の BADFUNC クラスを含む BSI 関連クラスを有効にするには、 bsi 設定プリセットを使用してください。

解決法

signal() の使用は避けてください。

もしくは(同じシグナルハンドラへの複数回呼び出しも含め)シグナルハンドラ呼び出しのオーバーラップが除去されており、 シグナルが必要以上の特権で実行されておらず、(シグナルハンドラについての情報も含め)開発者にシグナルが発生時の注意を行っていることを確認してください。

問題がないことを確認できた場合は、ワーニングの stateSuppressed (抑制)に変更して除外することができます。

関連のある設定ファイルパラメータ

このクラスは一般テンプレート設定ファイルで BAD_FUNCTION_* ルールセットによって実装されています。

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。

 

To report problems with this documentation, please visit https://support.codesecure.com/.