CVE-2026-10655: Use-after-free race in SNTP async client when closing the socket while the socket service is still polling it
The asynchronous SNTP client in Zephyr (subsys/net/lib/sntp/sntp.c, sntpcloseasync) closed the UDP socket file descriptor directly from the calling thread immediately after detaching it from the network socket service, without synchronizing with the socket-service poll thread.
The socket service thread polls each socket via zvfspoll, which (in zsockpollpreparectx) registers a kpollevent pointing into the socket's netcontext (&ctx->recvq) and then blocks in kpoll without holding a reference or lock. netcontext objects are allocated from a fixed pool (contexts[CONFIGNETMAXCONTEXTS]) and reused after close.
When sntpcloseasync is invoked from a different thread than the poll thread (in the in-tree consumer subsys/net/lib/config/initclocksntp.c, the SNTP timeout handler runs on the system workqueue while the socket service thread is blocked in poll on the same fd), the close frees and may reuse the netcontext while the poll thread still has a poller node linked into the freed object, resulting in a use-after-free / object confusion of kernel poll structures.
The SNTP timeout path is the normal no-response failure mode, so a network peer or off-path attacker who drops or delays the SNTP/NTP response can drive the racing close repeatedly (and periodically with NETCONFIGSNTPINITRESYNC). The most likely consequence is a crash of the networking thread (denial of service), with potential memory corruption when the freed context slot is reallocated.
The fix defers the close to the socket service thread itself via netsocketserviceclose (NETSOCKETSERVICECLOSESOCKETS), so the same thread that polls performs the close, eliminating the race. Affected releases: v4.2.0 through v4.4.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Zephyr asynchronous SNTP client (subsys/net/lib/sntp/sntp.c)to a version that resolves this vulnerability.Fixed in v4.2.0 through v4.4.0 - Configuration
Apply the fix so SNTP socket closure is deferred to the socket service thread by using net_socket_service_close (NET_SOCKET_SERVICE_CLOSE_SOCKETS), ensuring the same thread that polls performs the close and eliminating the close-vs-poll race in sntp_close_async.
Zephyr net_socket_service NET_SOCKET_SERVICE_CLOSE_SOCKETS = enabled/used
Event History
Frequently Asked Questions
What is the severity of CVE-2026-10655?
CVE-2026-10655 has a medium severity rating of 6.5.
How does CVE-2026-10655 impact the SNTP client in Zephyr?
CVE-2026-10655 can lead to a use-after-free condition when the SNTP asynchronous client closes the socket without proper synchronization.
Is there a fix available for CVE-2026-10655?
Yes, the recommended fix involves synchronizing the socket closure with the socket-service polling thread.
What type of vulnerability is CVE-2026-10655 classified as?
CVE-2026-10655 is classified as a use-after-free vulnerability.
Which software is affected by CVE-2026-10655?
CVE-2026-10655 affects the Zephyr operating system.