CWE-364
Weakness AllowedSignal Handler Race Condition
Abstraction: Base · Status: Incomplete
The product uses a signal handler that introduces a race condition.
These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the "regular" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free() is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
There are several known behaviors related to signal handlers that have received the label of "signal handler race condition":
Shared state (e.g. global data or static variables) that are accessible to both a signal handler and "regular" code
Shared state between a signal handler and other signal handlers
Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
Avoiding shared state
Using synchronization in the signal handler
Using synchronization in the regular code
Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)
Mapping guidance
This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Relationships and members
Modes of introduction
Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions.
Detection methods
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Content history
updated Time_of_Introduction
updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings
updated Observed_Examples, References
updated Common_Consequences, Demonstrative_Examples, Description, Observed_Examples, Other_Notes, Potential_Mitigations, Relationships
updated Common_Consequences
updated Demonstrative_Examples, References, Relationships
updated Demonstrative_Examples, References
updated Relationships, Taxonomy_Mappings
updated Observed_Examples, Relationships
updated References, Relationships
updated Potential_Mitigations
updated Relationships, Research_Gaps
updated Description
updated References, Relationships, Time_of_Introduction
updated Mapping_Notes
updated Detection_Factors, Weakness_Ordinalities
updated Common_Consequences, Description, Modes_of_Introduction
32 vulnerabilities reference this CWE, most recent first.
GHSA-W9FF-9CJH-6463
Vulnerability from github – Published: 2026-05-27 15:33 – Updated: 2026-09-14 12:31In the Linux kernel, the following vulnerability has been resolved:
ALSA: aloop: Fix peer runtime UAF during format-change stop
loopback_check_format() may stop the capture side when playback starts with parameters that no longer match a running capture stream. Commit 826af7fa62e3 ("ALSA: aloop: Fix racy access at PCM trigger") moved the peer lookup under cable->lock, but the actual snd_pcm_stop() still runs after dropping that lock.
A concurrent close can clear the capture entry from cable->streams[] and detach or free its runtime while the playback trigger path still holds a stale peer substream pointer.
Keep a per-cable count of in-flight peer stops before dropping cable->lock, and make free_cable() wait for those stops before detaching the runtime. This preserves the existing behavior while making the peer runtime lifetime explicit.
{
"affected": [],
"aliases": [
"CVE-2026-46090"
],
"database_specific": {
"cwe_ids": [
"CWE-364",
"CWE-416"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-27T14:17:30Z",
"severity": "HIGH"
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nALSA: aloop: Fix peer runtime UAF during format-change stop\n\nloopback_check_format() may stop the capture side when playback starts\nwith parameters that no longer match a running capture stream. Commit\n826af7fa62e3 (\"ALSA: aloop: Fix racy access at PCM trigger\") moved\nthe peer lookup under cable-\u003elock, but the actual snd_pcm_stop() still\nruns after dropping that lock.\n\nA concurrent close can clear the capture entry from cable-\u003estreams[] and\ndetach or free its runtime while the playback trigger path still holds a\nstale peer substream pointer.\n\nKeep a per-cable count of in-flight peer stops before dropping\ncable-\u003elock, and make free_cable() wait for those stops before\ndetaching the runtime. This preserves the existing behavior while\nmaking the peer runtime lifetime explicit.",
"id": "GHSA-w9ff-9cjh-6463",
"modified": "2026-09-14T12:31:29Z",
"published": "2026-05-27T15:33:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-46090"
},
{
"type": "WEB",
"url": "https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-46090.json"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/e5c33cdc6f402eab8abd36ecf436b22c9d3a8aff"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/d258cdce50ff3e02392917258e81a0ce9555c327"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/bdd9503c3d222d2735b56c7a8b4422ccf3de6e5c"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/83bd62fa9620ac98d5d694bde14c50f98c8e7189"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/5d45e34bf001344e2966dabca1897561bbc9e913"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/3727a3541788412c393eec236ad228d72efe19c7"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/345c24b2bcf0923dfae1ab41497351c68214ff76"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/03f52a9c170431e8f10e156b9dc0dae80b3e9198"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2481980"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-46090"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:41236"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:35896"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:35863"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:35844"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:34443"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:34095"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:34094"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:33900"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:33899"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:33685"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:33215"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:30848"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:27354"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:27353"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X7WW-99CR-QMMW
Vulnerability from github – Published: 2022-04-30 18:09 – Updated: 2025-10-20 18:30Race condition in signal handling routine in ftpd, allowing read/write arbitrary files.
{
"affected": [],
"aliases": [
"CVE-1999-0035"
],
"database_specific": {
"cwe_ids": [
"CWE-364"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "1997-05-29T04:00:00Z",
"severity": "MODERATE"
},
"details": "Race condition in signal handling routine in ftpd, allowing read/write arbitrary files.",
"id": "GHSA-x7ww-99cr-qmmw",
"modified": "2025-10-20T18:30:28Z",
"published": "2022-04-30T18:09:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-1999-0035"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/CVE-1999-0035"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-3
Strategy: Language Selection
Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
Mitigation
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.
Mitigation
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.
No CAPEC attack patterns related to this CWE.