The SocketCAN socket layer in subsys/net/lib/sockets/sockets_can.c dereferences a NULL device pointer when a NET_SOL_CAN_RAW socket option is read or…
The SocketCAN socket layer in subsys/net/lib/sockets/sockets_can.c dereferences a NULL device pointer when a NET_SOL_CAN_RAW socket option is read or written on a CAN socket that has not yet been bound. A freshly created CAN socket has interface index -1. net_context_get_iface() therefore returns NULL, net_if_get_device() returns NULL, and can_sock_setsockopt_vmeth() / can_sock_getsockopt_vmeth() read dev->api without a check and then call through the resulting pointer. Any thread that can create a CAN socket can trigger the dereference by calling setsockopt() or getsockopt() at level SOL_CAN_RAW before bind(). That ordering is common in code ported from Linux. Because zsock_socket, zsock_se
Read at NIST National Vulnerability Database (CVE API 2.0)
- Vendor
- Zephyrproject
- Product
- zephyr
- CVSS v3.1
- 5.5 AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- Weakness
- CWE-476
- NVD status
- Awaiting Analysis
Why it ranks 5 (Routine)
- CVSS v3.1 5.5 medium
- Recency: items published within 24 hours gain 15, within 72 hours 6, within 7 days 2.