Files
ocserv/tests
Nikos Mavrogiannopoulos c5c921528d worker: reject client MTU below MIN_MTU to prevent unsigned underflow
DATA_MTU(ws, mtu) performs unsigned subtraction.  A client advertising
X-CSTP-Base-MTU or X-CSTP-MTU smaller than the combined DTLS overhead
(IP + UDP + DTLS record + crypto) causes the result to wrap to ~UINT_MAX,
which then reaches memset(), tun_read(), and IPC calls.

Fix: enforce MIN_MTU(ws) (800 for IPv4, 1280 for IPv6) as the lower
bound when accepting client-supplied link_mtu and tunnel_mtu values.
Values below the floor are logged and ignored; the server's own MTU
is used instead.  Add a defense-in-depth lower-bound check in
link_mtu_set() and a runtime assert after calc_mtu_values() that fires
in CI if a future cipher or protocol change erodes the safety margin.

Resolves: #717

Signed-off-by: Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
2026-06-07 08:29:52 +02:00
..
2026-05-31 14:17:33 +02:00
2022-11-28 11:22:33 +01:00
2023-06-10 16:21:34 +08:00
2021-11-01 10:23:01 +01:00
2026-05-01 19:26:45 +00:00
2026-05-31 14:17:33 +02:00
2023-06-10 16:21:34 +08:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2022-11-28 11:22:33 +01:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2023-06-10 16:21:34 +08:00
2023-06-10 16:21:34 +08:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00
2026-05-31 14:17:33 +02:00