CWE-663 · Słabość
Use of a Non-reentrant Function in a Concurrent Context
- Abstrakcja
- Bazowa
- Status
- Szkic
- Dodano
- 11 kwietnia 2008
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The product calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.
Skutki
Integrity, Confidentiality, Other
Modify Memory; Read Memory; Modify Application Data; Read Application Data; Alter Execution Logic
Zapobieganie
Implementation
Use reentrant functions if available.
Implementation
Add synchronization to your non-reentrant function.
Implementation
In Java, use the ReentrantLock Class.
Przykłady podatności
- CVE-2001-1349 unsafe calls to library functions from signal handler
- CVE-2004-2259 SIGCHLD signal to FTP server can cause crash under heavy load while executing non-reentrant functions like malloc/free.
Słabość nadrzędna
Słabości podrzędne
Kiedy powstaje
- Implementation
Dotyczy
Not Language-Specific, C
Źródła
- Java Concurrency API — SUN, Class ReentrantLock
- Use reentrant functions for safer signal handling — Dipak Jha, Software Engineer, IBM
Wpis z katalogu CWE 4.20.