Skip to content
Medium 6.1

Unvalidated userspace pointer dereference in zsock_getsockopt syscall verifier allows limited kernel memory disclosure and system halt

CVE-2026-86086 First seen on SecPulse

Affected packages

PackageAffected → Fixed
zephyrprojectzephyr
≥ 2.0.0, < 4.3.2→ 4.3.2
≥ 4.4.0, < 4.5.0→ 4.5.0
Original description The description as published by the source.

The CONFIG_USERSPACE syscall verifier for getsockopt() in subsys/net/lib/sockets/sockets.c dereferenced the caller-supplied optlen pointer without validating it. z_vrfy_zsock_getsockopt() began with net_socklen_t kernel_optlen = (net_socklen_t )optlen;, reading four bytes through an unprivileged thread's pointer while executing in supervisor mode, before any K_SYSCALL_MEMORY_READ or k_usermode_from_copy() check. Every sibling verifier in the same file — z_vrfy_zsock_accept(), z_vrfy_zsock_recvfrom(), z_vrfy_zsock_getpeername(), z_vrfy_zsock_getsockname() — validated the equivalent addrlen pointer correctly; getsockopt was the sole outlier.

zsock_getsockopt() is declared __syscall in include/zephyr/net/socket.h, so any user-mode thread holding (or able to create) a socket can invoke it directly with an arbitrary pointer value. No preparation, race, or heap grooming is required: a single call is enough. The issue is only present in builds with CONFIG_USERSPACE=y and CONFIG_NET_SOCKETS=y, which is precisely the configuration intended to contain an untrusted thread.

The word read is not returned to the caller directly: the trailing k_usermode_to_copy() writes the updated length back through optlen itself, and for a kernel address that write is rejected with a kernel oops. The leak is instead an oracle. The word read through optlen becomes the length checked by K_SYSCALL_MEMORY_WRITE(optval, kernel_optlen): a value larger than the caller's writable span at optval fails cleanly w…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details