1 vulnerabilities classified as CWE-479 (信号处理例程中使用不可再入的函数). AI Chinese analysis included.
CWE-479 represents a critical concurrency weakness where a signal handler invokes a non-reentrant function, violating the assumption that such routines can be safely interrupted and recalled. This flaw typically manifests when asynchronous signals, such as interrupts or exceptions, preempt the execution of a function that maintains internal state or uses static data structures. If the signal arrives while the function is mid-execution, the re-entry causes memory corruption, data inconsistency, or unpredictable system states, potentially leading to denial of service or code execution. Developers mitigate this risk by ensuring signal handlers only call async-signal-safe functions, which are guaranteed to be reentrant. Alternatively, they can defer complex processing to a separate thread or context, ensuring that the handler performs minimal, safe operations before returning control to the interrupted flow, thereby preserving system integrity and preventing race conditions.
char *message; void sh(int dummy) { syslog(LOG_NOTICE,"%s\n",message); sleep(10); exit(0); } int main(int argc,char* argv[]) { ... signal(SIGHUP,sh); signal(SIGTERM,sh); sleep(10); exit(0); } If the execution of the first call to the signal handler is suspended after invoking syslog(), and the signal handler is called a second time, the memory allocated by syslog() enters an undefined, and possibly, exploitable state.| CVE ID | Title | CVSS | Severity | Published |
|---|---|---|---|---|
| CVE-2021-26948 | HTMLDOC 代码问题漏洞 — htmldoc | 7.8 | - | 2022-03-03 |
Vulnerabilities classified as CWE-479 (信号处理例程中使用不可再入的函数) represent 1 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.