CWE-364

Signal Handler Race Condition

High

Description

The product uses a signal handler that introduces a race condition.

Potential Impact

How to Fix

Requirements

Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

Architecture and Design

Design signal handlers to only set flags, rather than perform complex functionality. These flags can then be checked and acted upon within the main program loop.

Implementation

Only use reentrant functions within signal handlers. Also, use validation to ensure that state is consistent while performing asynchronous actions that affect the state of execution.

Detection Methods

Related Weaknesses

References

View on MITRE CWE Database →

Need Help Fixing This Vulnerability?

Our security experts can help you identify and remediate CWE-364 vulnerabilities in your codebase.

Get Security Assessment