open5gs/lib/gtp
Sukchan Lee f7ec6ea2ed gtp: harden parsers against malformed IE lengths and remove assert-based crashes
This patch improves robustness of several GTPv1/v2 parsing paths by
adding explicit length validation and replacing assert-based checks
on network-controlled data with graceful error handling.

Changes include:

- GTPv1 MM Context parser:
  Add bounds checks for xres_len, autn_len and num_vectors to prevent
  stack overflows when decoding authentication quintuplets.

- SMF Gn handler:
  Validate IMEI(SV) IE length before memcpy to prevent heap overflow
  in smf_ue->imeisv.

- SMF Gn handler:
  Validate Common Flags IE length before dereferencing to avoid
  out-of-bounds reads when malformed IE is received.

- GTPv1 ULI parser:
  Replace ogs_assert-based length checks with proper validation and
  error return to prevent abort() on truncated User Location
  Information IE.

- SMF fd-path:
  Replace assertions on ULI payload presence with runtime checks
  to avoid process termination on malformed input.

These changes ensure malformed or truncated network messages are
handled gracefully instead of triggering process aborts.
2026-03-14 08:44:51 +09:00
..
v1 gtp: harden parsers against malformed IE lengths and remove assert-based crashes 2026-03-14 08:44:51 +09:00
v2 gtp2: Add runtime boundary validation in ogs_gtp2_parse_tft() 2026-02-28 22:17:00 +09:00
context.c [SMF] If GTPU conf has advert addr, use it in up2cp FAR 2025-06-10 17:06:27 +09:00
context.h Initial metrics support based on Prometheus (#1571) 2022-06-08 05:51:02 +09:00
meson.build [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
ogs-gtp.h [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
path.c [HR] Implement GTP-U processing for HR Roaming in User Plane (#2194) 2024-11-23 17:51:42 +09:00
path.h Merge branch 'main' into home-routed 2025-06-17 17:34:46 +09:00
util.c [GTP] Incorrect destination TEID=0 (#3043) 2024-04-06 16:39:32 +09:00
util.h [GTP] Incorrect destination TEID=0 (#3043) 2024-04-06 16:39:32 +09:00
xact.c Follow-up on #4220, #4221 2026-01-11 16:02:28 +09:00
xact.h MME: handle EPS Bearer Context Status mismatch when active_flag=0 (#4112) 2025-10-16 21:46:38 +09:00