Commit graph

5054 commits

Author SHA1 Message Date
Sukchan Lee
ad3939296d [nas] Reject malformed IMSIs across 4G and 5G paths
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
TS 23.003 limits an IMSI to 15 decimal digits, but several identity
conversion paths accepted overlong or non-decimal values.

Validate null-scheme SUCI MSINs before constructing SUCI and SUPI
strings. Centralize SUCI validation in the NAS conversion helper and
propagate failures through AMF Registration Request and Identity
Response handling with 5GMM cause 95. Keep detailed error logging at
each failure stage.

Validate MCC, MNC and MSIN components when reconstructing an IMSI SUPI
in the SBI layer, and improve UDM logging when SUCI conversion fails.

Validate EPS IMSIs before modifying MME context or hash state. Reject
non-decimal BCD values and invalid IMSI lengths in Attach Request and
Identity Response handling.

Also validate the peer-controlled IMSI IE in Gn SGSN Context Request
and Response messages. An 8-octet TBCD value without a filler nibble
decodes to 16 digits plus a trailing NUL, which overflowed the previous
16-byte stack buffer before validation. Use a 17-byte temporary decode
buffer, reject IMSI IEs longer than 8 octets, and continue enforcing the
15-digit IMSI limit after conversion.

Update registration tests to normalize MSIN padding only for
null-scheme SUCIs, preserve protected scheme output, assert successful
test SUCI conversion, record returned GMM causes, and verify rejection
of an overlong SUCI.
2026-07-18 16:28:00 +09:00
Sukchan Lee
fc0da1ac14 app: extend QoS profiles to PCF and PCRF media types
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Add optional media_type mapping to the shared QoS profile configuration
for audio, video and control traffic.

Use the configured media type mapping in both PCF and PCRF. Fall back to
the existing QCI/5QI 1, 2 and 5 defaults when no matching profile is
configured.

Update PCRF control-media handling to compare the default bearer against
the configured signaling QCI instead of the fixed QCI 5 value.

Emit deprecation warnings for legacy inline policy and QoS profile
configuration, directing users to policy.yaml and the top-level
policy_file option.

Update policy.yaml documentation with the shared PCF/PCRF QoS profile
behavior and combined reference and media_type examples.
2026-07-15 13:51:38 +09:00
Sukchan Lee
19b1347078 app: add shared file-backed policy configuration
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Move policy, slice and QoS profile parsing into lib/app so PCF and
PCRF use the same configuration structures and lookup functions.

Parse the optional policy_file during application initialization and
support supi_range, slice, session and qos_profiles sections. Use the
file-backed policy when a matching SUPI is found and retain the existing
MongoDB fallback when no file policy matches.

Update PCF and PCRF to use the shared policy parser, default slice
selection and QoS profile lookup. Keep the existing inline policy format
for compatibility, but reject configurations that mix inline policy data
with policy_file.

Limit policy matching to SUPI ranges and reject plmn_id in policy
configuration.
2026-07-14 15:30:16 +09:00
Sukchan Lee
1d366d8e3b app: add common loader for external YAML files
Add optional subscriber_file and policy_file settings to the global
application configuration.

Refactor the existing configuration reader into a common YAML document
loader shared by the main configuration, subscriber file and policy file.
Apply the same parser error reporting and root mapping validation to all
three document types.

Validate the top-level subscriber, policy and qos_profiles sections, and
store the parsed external documents in the application context for later
subscriber and policy processing.

Centralize YAML document cleanup in the application context to avoid
duplicate free logic.
2026-07-14 13:42:44 +09:00
Sukchan Lee
33344b4699 config: add external subscriber and policy files
Add common YAML files for file-backed subscriber provisioning and policy
configuration.

Add optional top-level subscriber_file and policy_file settings to HSS,
UDR, PCRF and PCF configurations. The options remain commented by default,
preserving the existing MongoDB-backed behavior.

Install the new subscriber.yaml and policy.yaml templates, and migrate the
multi-PLMN SEPP examples from inline PCF policies to per-instance external
policy files.

The subscriber template includes the default Open5GS test subscriber.
Runtime SQN updates are maintained in memory and recovered through AKA
resynchronization after restart.
2026-07-14 10:43:57 +09:00
Sukchan Lee
e2aeae26d7 amf/udm/udr: Optimize SDM retrieval using dataset-names
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Retrieve AM and SMF selection subscription data in a single Nudm_SDM
request using the dataset-names query parameter.

Parse combined Nudm_SDM responses as ProvisionedDataSets and process the
AM and SMF selection data sequentially while preserving the existing
UE context in SMF lookup.

Forward the requested serving PLMN from UDM to UDR, falling back to the
UE GUAMI PLMN when it is not provided.

Also limit the UDR UE-AMBR validation to requests that actually include
subscribedUeAmbr, and safely ignore delayed combined responses received
after the UE has moved to another GMM state.

Issues: #4683
2026-07-13 13:48:06 +09:00
Sukchan Lee
2502a9cca3 scp: improve SBI error handling
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Return 400 Bad Request for malformed SCP requests instead of falling
back to a generic 500 response. Distinguish missing and invalid
User-Agent headers, preserve the original header while parsing the NF
type, and validate mandatory discovery headers consistently.

Return 504 Gateway Timeout with TARGET_NF_NOT_REACHABLE when the target
NF cannot be reached, and NRF_NOT_REACHABLE when NRF discovery fails.

Avoid fallback 500 responses after a callback has already sent a
response by revalidating MHD sessions and HTTP/2 streams. Also fix
nnrf URI string leaks on error paths.

Issues #4681 and #4682
2026-07-12 13:09:28 +09:00
Sukchan Lee
9468de94ca amf,mme: Validate UE associations in partial reset
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Validate that UE contexts referenced by partial NG RESET and S1 RESET
belong to the gNB or eNB that sent the request.

When both core-network and RAN UE identifiers are present, also verify
that they refer to the same UE association. This prevents a peer from
resetting a UE owned by another RAN node or supplying mismatched UE IDs.

Guard the deferred reset acknowledgement paths against a missing
acknowledgement buffer without aborting or interrupting the remaining
session cleanup.

Issues: #4680
2026-07-11 21:13:56 +09:00
Sukchan Lee
c9abe09421 hss: Reject empty Cx identity AVPs
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Validate User-Name and Public-Identity before passing them to the HSS
context lookup functions.

A zero-length identity could otherwise be used as a hash key and trigger
an assertion in ogs_hash_get(), terminating the HSS.

Return DIAMETER_INVALID_AVP_VALUE for empty identities in UAR, MAR, SAR,
and LIR requests.

Issues #4675
Issues #4676
2026-07-10 10:54:38 +09:00
Sukchan Lee
72913dc927 smf: Handle QoS flow description delete
When processing a UE-requested PDU Session Modification Request, the
SMF treated every Requested QoS flow description as a QoS parameter
modification regardless of its operation code.

If the UE deletes a dedicated QoS flow by sending both:

    - Delete existing QoS rule
    - Delete existing QoS flow description

for the same QFI, the QoS rules handler sets OGS_PFCP_MODIFY_REMOVE,
but the QoS flow descriptions handler also set
OGS_PFCP_MODIFY_QOS_MODIFY. This produced an invalid
REMOVE|QOS_MODIFY combination and tripped the invariant in
gsm_handle_pdu_session_modification_request(), aborting smfd during
VoNR call teardown.

A "Delete existing QoS flow description" carries no QoS parameters, so
skip the QoS-parameter update path for that operation and let the QoS
rule deletion drive the actual PFCP removal.

Also update the test GSM message builder to encode QoS rule deletion
without packet filters, and add a VoNR regression test for the
UE-initiated dedicated QoS flow deletion case.

Issues #4672
2026-07-10 10:07:09 +09:00
Sukchan Lee
b7068fd572 sbi: Move vendored cJSON to lib/third-party
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Move the vendored cJSON copy out of the generated OpenAPI tree:

```
lib/sbi/openapi/external/cJSON.{c,h}
-> lib/third-party/cjson/cJSON.{c,h}
```

The copy under lib/sbi/openapi/external/ came from the OpenAPI generator
output, but cJSON is a third-party dependency rather than generated SBI
model code. Keep it in lib/third-party/cjson/ as the single canonical
vendored copy.

Update the current openapi-generator template sets accordingly so that
regenerated model code includes the relocated header directly:

```
```

This avoids any post-processing after regeneration and works regardless
of which generated source directory includes the header, since the path
no longer depends on "../" relative traversal.

Notes:

* The generator still emits an external/cJSON.{c,h} pair from
  cJSON.{c,h}.mustache into its output directory. That generated copy is
  no longer copied into the source tree.

* The older template sets (r16 5.2.0/6.4.0, r17 6.4.0/7.20.0) are left
  untouched as a historical record of what generated past trees.
2026-07-09 10:57:33 +09:00
Sukchan Lee
c18dc6938b PCRF: validate Framed-IP AVP lengths in Rx/Gx
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Validate Framed-IP-Address before using it as an IPv4 hash key in
Rx AAR handling. A malformed AVP shorter than 4 bytes could otherwise
lead to an out-of-bounds read.

Also validate Framed-IPv6-Prefix before casting it to ogs_paa_t in
Rx AAR and Gx CCR handling. This prevents dereferencing a short buffer
when checking the IPv6 prefix length.

Issues #4663 and #4664
2026-07-08 16:45:13 +09:00
Marcel Aust
02ead0c16c chore: add the same check from PR 4425 until a more comprehensive approach is implemented
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
2026-07-07 21:06:26 +09:00
Sukchan Lee
2d2060ebcc mme, amf: rebind SCTP stream after RAN handover
UE-associated SCTP streams are allocated per RAN association.

During X2 or Xn handover, the UE context can retain a stream ID that
was valid for the source eNB or gNB but is outside the target RAN's
negotiated stream range. Sending Path Switch Request Acknowledge on
that stream then fails with EINVAL.

Rebind the stream using the target RAN allocator only when the
existing stream ID is out of range.

Issues: #4670
2026-07-07 21:00:41 +09:00
Sukchan Lee
357728094e sgwc: handle Delete Bearer Response after S5-C xact expiry
Avoid asserting when an S11 Delete Bearer Response arrives after its
associated S5-C transaction has already been removed.

There is no response left to relay to the PGW in this case, but the
SGW-C must still complete local cleanup. Delete the PFCP session for a
Linked EPS Bearer ID, or remove the affected PFCP bearer for an EPS
Bearer ID.

Keep the associated S5-C transaction assertion for the Bearer Resource
Command path, which requires transaction-specific data.

Issues: #4667
2026-07-07 20:07:39 +09:00
Sukchan Lee
b9caeed69f upf: suppress Error Indication for off-filter G-PDU
Do not send a GTP-U Error Indication when the received TEID is
owned by an existing PDR but the packet does not match its QFI or
SDF filter.

Such a packet is off-filter, not an unknown tunnel. Sending an Error
Indication can cause the peer to remove a live bearer, for example
after a stray uplink packet during X2 handover.

Keep the existing Error Indication behavior for TEIDs that are not
owned by any PDR.

Issues: #4665
2026-07-07 20:00:58 +09:00
Sukchan Lee
a9c82ee0b5 hss: Validate Visited-PLMN-Id length in AIR handling
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Reject malformed Visited-PLMN-Id AVPs before KASME derivation and
use the validated local PLMN ID buffer.

Issues: #4661
2026-07-06 13:58:47 +09:00
Sukchan Lee
fdea4cc181 [SMF/MME] Recover the IMS PDN on an EPC GTP-U Error Indication
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
On a GTP-U Error Indication for an EPC session, the SMF deleted the whole
PFCP session for any Error Indication and never notified the MME. A single
transient, handover-induced Error Indication on a dedicated (voice) bearer
therefore tore down the entire IMS PDN, and because no Delete Bearer
Request was sent to the MME, the MME and UE kept a stale IMS PDN
connection - the UE could not place a new VoLTE call until it re-attached.

SMF (src/smf/n4-handler.c, src/smf/pfcp-path.c):
Map the Error Indication FAR to its bearer and run a PGW-initiated bearer
deactivation instead of a blind session deletion, per 3GPP TS 23.007:
  - dedicated bearer -> deactivate only that bearer (IMS PDN survives);
  - default bearer   -> deactivate the whole PDN connection.
smf_gtp2_send_delete_bearer_request() sets the Linked EBI (default) or the
EPS Bearer ID (dedicated), so the MME deactivates the EPS bearer toward the
UE and stays in sync. The PFCP session is deleted on the Delete Bearer
Response (wait_pfcp_deletion). The default-bearer case uses cause
"Reactivation requested" so the UE re-establishes the PDN.

MME (src/mme/mme-s11-handler.c, mme-path.c, mme-context.h, nas-path.c,
nas-path.h, esm-sm.c):
Map the GTPv2 Cause "Reactivation requested" (#8) on a default-bearer
Delete Bearer Request to NAS ESM cause #39 "reactivation requested"
(TS 29.274 Table C.3) so the UE re-establishes the IMS PDN. The mapping is
restricted to the default bearer (Linked EBI). Carry the ESM cause across
paging in mme_ue->paging.esm_cause so an ECM-IDLE UE also receives it after
paging; previously the post-paging path always used REGULAR_DEACTIVATION.

The TS 29.274 Table C.3 "re-attach required" mapping for the last PDN
connection is intentionally not implemented (Attach without PDN
connectivity and SCEF PDN connections are not supported here); the last
default bearer is deactivated with ESM cause #39 as well.

Issues: #4659
2026-07-01 20:05:57 +09:00
Sukchan Lee
32d140e9a5 sgwc: reclaim orphaned indirect forwarding tunnels
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Remove local indirect forwarding tunnels after PFCP modification
synchronization even when the associated S11 transaction has expired.

Also release the PDR TEID node on per-session PDR ID allocation
failure and add diagnostics for PDR resource exhaustion.

Issues: #4653
2026-06-29 09:30:25 +09:00
Paul Mataruso
e661610578 docs: update hardware list and community documentation
- Add Sercom SCE5164 to the tested hardware list
- Add a community tutorial for SEPP-based 5G roaming using
  Open5GS, Docker, and PacketRusher
2026-06-29 09:13:39 +09:00
Joran Osinga
2f143316ba sgwc: avoid abort on delete session without gnode
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Signed-off-by: Joran Osinga <jojoosinga@gmail.com>
2026-06-28 09:13:49 +09:00
Sukchan Lee
d16c9e5d6d sbi: Fix NULL list-add abort on map values of type DateTime/array
OpenAPI_nf_profile_parseFromJSON() aborts via ogs_assert(data) in
listEntry_create() when an NFProfile carries a non-empty
nfSetRecoveryTimeList / serviceSetRecoveryTimeList. OSS-Fuzz:

  listEntry_create: Assertion `data' failed (lib/sbi/openapi/src/list.c:10)
  OpenAPI_list_add (list.c:116)
  OpenAPI_nf_profile_parseFromJSON (nf_profile.c:3989)

Root cause is in the model-body.mustache map handler. The per-value
type dispatch only emits assignments to localMapKeyPair for
isString / isByteArray / isNumeric / isBoolean. For a map whose value
is a DateTime (map<string,DateTime>, e.g. NfSetRecoveryTimeList) or an
array (map<string,array<string>>, e.g. allowedOperationsPerNfType),
no branch fires, localMapKeyPair stays NULL, and the generated code
calls OpenAPI_list_add(list, NULL) -> listEntry_create(NULL) -> abort.
This is remotely triggerable: NFProfile is parsed from peer/NRF input.

Template fix (r19, openapitools 7.20.0):
  - add isDate / isDateTime branches in both parseFromJSON and
    convertToJSON map blocks (DateTime is carried as a JSON string,
    handled like isString); convertToJSON previously also dropped the
    value silently for these maps.
  - guard OpenAPI_list_add with a NULL check so any remaining
    unhandled value category (e.g. array-valued maps) fails the parse
    gracefully instead of aborting the process.

Regenerated the two affected models (nf_profile, nf_service).
DateTime maps now round-trip correctly; the array-valued maps are
rejected instead of crashing pending full map<string,array> support.

Issues: #4649
2026-06-28 08:34:51 +09:00
Sukchan Lee
76d2237c0e nas: fix uninitialized read in NAS DNN/APN decode
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
ogs_fqdn_parse() returns -EINVAL on invalid FQDN encoding, but the DNN
and APN decoders stored the result directly into the uint8_t length
field. The negative value was truncated (-22 -> 234), so the
"if (length > 0)" guard passed and ogs_cpystrn() copied up to 101 bytes
from an uninitialized stack buffer that ogs_fqdn_parse() never wrote.

The guard was written when ogs_fqdn_parse() returned 0 on failure; the
later switch to -EINVAL broke it via the unsigned truncation.

Capture the return value in a signed int, take the error branch on
negative/zero, and assign to length only on success. Applied to both
ogs_nas_5gs_decode_dnn and ogs_nas_eps_decode_access_point_name via the
support/type-list.py templates; generated ies.c regenerated.

Found by OSS-Fuzz (nas_5gs_message_fuzz, MSan).

Issues: #4645
2026-06-27 11:40:33 +09:00
Sukchan Lee
8ea1e7bf69 sbi: reject unconfirmed NF status notifications
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Accept NF status notifications only when they match a subscription
confirmed by the NRF. Reject notifications outside the confirmed
subscription state with 404 Not Found before updating or removing the
local NF cache.

Apply the same validation to both NF_REGISTERED and NF_DEREGISTERED
notifications.
2026-06-27 08:44:16 +09:00
Sukchan Lee
d78447a36c sbi: share NF status subscription lookup
Move the NF status subscription lookup from nf-sm.c to the SBI
context so it can be reused by notification handling.

Keep the existing lookup semantics for subscription creation, including
subscriptions that have been requested locally but are not yet confirmed
by the NRF.
2026-06-27 08:44:16 +09:00
Sukchan Lee
d747860dca amf/mme: release newly allocated RAN/eNB UE contexts on error paths
Release RAN-UE and eNB-UE contexts when processing fails after a
new context has been allocated.

Malformed InitialUEMessage messages and failed handover target setup
could leave newly created contexts in their respective pools until the
peer association was closed. Repeated failures could therefore exhaust
the RAN/eNB UE context pool and prevent legitimate UE procedures.

Only contexts allocated for the current message are removed, preserving
pre-existing UE contexts on duplicate or malformed messages.
2026-06-26 22:01:34 +09:00
Sukchan Lee
adbc9a3117 amf,mme: validate RAN ownership for UE context release
Validate that UE Context Release Request is received from the gNB/eNB
owning the resolved UE context and that the RAN-side UE ID matches.

Apply ownership validation to UE Context Release Complete as well, while
preserving its existing AMF/MME UE ID-based completion handling without
requiring a RAN-side UE ID consistency match.

Keep the procedure-specific lookup paths so unknown UE contexts retain
their existing warning-level handling and Error Indication behavior.
2026-06-26 17:11:41 +09:00
Sukchan Lee
100ee681e2 hss/cx: Stop IMSI extraction at IMPI realm separator
Cx User-Name may contain an IMSI-based IMPI in the form of <IMSI>@ims.mnc<MNC>.mcc<MCC>.3gppnetwork.org.

Do not parse digits from the realm portion when converting the
User-Name into a BCD subscriber identifier. Otherwise, digits in the
MNC, MCC, and domain name can cause a valid IMPI to be rejected as an
invalid or overlong IMSI.

Issues: #4633
2026-06-26 14:57:27 +09:00
Sukchan Lee
a30745e382 amf: preserve target RAN UE context for handover cancel
Store the target RAN UE ID in the SBI transaction context when sending
an Update SM Context request. Use the saved ID when processing the SMF
response so that the target RAN context can still be released even if
the source RAN context has already been removed.

This also avoids an AMF assertion failure during the handover-cancel
response race.

Issues: #4631
2026-06-26 14:35:57 +09:00
dchard
3ee7e055f7 [MME] Add network policy (TS 24.301 9.9.3.52)
This commit adds the network policy IE, part of ATTACH ACCEPT and
TAU ACCEPT messages. This prevents unsecured redirection to GERAN
or UTRAN, protecting the UEs from unsecured redirection attacks.
This IE is mandatory in Rel.19

This patch changes the default behavior!

In case you want to allow unsecured redirects, add the following:

```
global:
  parameter:
    allow_unsecured_redirection: true
```

to your mme.yaml
2026-06-26 13:04:18 +09:00
Arthur Chan
ec6b76dccf OSS-Fuzz: Create new fuzzers targets sbi processing
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-25 07:49:17 +09:00
Arthur Chan
ef50ce562a OSS-Fuzz: Add two new fuzzers target pfcp and nas-5gs message processing
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-24 07:21:48 +09:00
Sukchan Lee
d13daddc05 ipfw: prevent crash on empty flow description
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
ogs_strtok_r() returns NULL when the flow description is empty or
contains only spaces. Check the first token before comparing it with
"permit" so that NULL is not passed to strcmp().

Invalid flow descriptions now return OGS_ERROR through the existing
error path instead of crashing the SMF or UPF process.

Issues: #4630
2026-06-23 17:21:23 +09:00
Sukchan Lee
456b70dcb0 nas: prevent abort on malformed EPS service request
Issues: #4629
2026-06-23 17:17:52 +09:00
Arthur Chan
de50a1568f OSS-Fuzz: Add new fuzzer targets s1ap message processing
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-23 08:38:52 +09:00
Sukchan Lee
a420fefa13 smf: avoid abort on missing Non-3GPP session during handover
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
Handle failure to deactivate the old Non-3GPP session after a
Non-3GPP to 3GPP handover as a non-fatal error.

The Modify Bearer Response has already been sent at this point, so a
missing or already released WLAN session must not terminate the SMF.
Log the deactivation failure and continue instead of asserting.

Issues: #4636
2026-06-22 17:04:52 +09:00
Arthur Chan
60e43ece0b OSS-Fuzz: Add new fuzzer targets ngap message processing
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-20 22:21:43 +09:00
Ferran Cañellas
fdcee01eaf pcf: send TerminationInfo body in policyauthorization terminate notify 2026-06-20 22:21:26 +09:00
Sukchan Lee
02de520791 sbi: prevent multipart buffer overflow
Check available space before copying multipart body parts and reserve
space for the closing boundary and terminating NUL character.

Issues: #4624
2026-06-20 20:08:53 +09:00
Sukchan Lee
d2707b0c39 amf: fix AMF crash when sending UE Security Capabilities in path switch ack
In ngap_build_path_switch_ack(), the UESecurityCapabilities IE block passed
&PathSwitchRequestAcknowledge->protocolIEs to ASN_SEQUENCE_ADD(), while every
other IE block in the function correctly passes protocolIEs without the
address-of operator.

Since the asn1c v6->v7 migration, protocolIEs is a pointer returned by
ogs_asn_calloc_protocol_ies(), so the extra '&' passes a pointer-to-pointer.
asn_sequence_add() then casts it to _A_SEQUENCE_OF and reads/writes array,
count and size at that location, corrupting the protocolIEs pointer and
adjacent fields in the PDU. This leads to a heap/wild-pointer write and
crashes the AMF.

The block only runs when send_ue_security_capability_in_path_switch_ack is
set, i.e. on a UE security capability mismatch during PathSwitchRequest, so
the bug stayed hidden until exercised by the Xn handover path. When it
triggers, the AMF dies before sending PATH SWITCH REQUEST ACKNOWLEDGE,
causing a guard-timer timeout on the handover and NGAP socket failures on
subsequent procedures.

Drop the stray '&' so the IE is appended to the correct sequence, and add
the missing ogs_assert(ie) for consistency with the other IE blocks.
2026-06-20 19:46:55 +09:00
Sukchan Lee
157f611a53 packaging: finalize v2.8.0 release
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
- Update Debian package descriptions for Release 19
- Correct the libmongoc count API version guard
- Refresh Ubuntu package revisions
- Update release announcement metadata
2026-06-20 13:10:28 +09:00
Sukchan Lee
960cc654e2 docs: update supported 3GPP release to Release 19 2026-06-20 12:39:48 +09:00
Sukchan Lee
c9e1fbb391 Release v2.8.0
- Add Release 19 announcement
- Update Ubuntu package revisions
- Support MongoDB C Driver 1.x and 2.x
- Use version-appropriate collection count APIs in tests
2026-06-20 12:39:48 +09:00
Sukchan Lee
0f79100ec6 Release v2.8.0
Upgrade to Release-19
Avoid ARG_MAX failures when linking generated ASN.1 and OpenAPI libraries
Update Debian package, documentation, and WebUI version metadata
2026-06-20 12:38:31 +09:00
Sukchan Lee
2c6c10650d debian: make MongoDB a recommended dependency
Some checks are pending
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run
MongoDB is required by database-backed components such as HSS/PCRF
and PCF/UDR, but it does not need to be installed locally when an
external MongoDB server is used.

Move the MongoDB package relationship from Depends to Recommends for
the affected Debian packages, so the default installation still pulls
MongoDB in while allowing users to opt out with --no-install-recommends.

Update the documentation to clarify which components use MongoDB and
explain that the MongoDB installation step can be skipped when using an
external database.
2026-06-17 22:42:10 +09:00
Sukchan Lee
75a29e0722 Merge branch 'main' into r19
Some checks failed
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Has been cancelled
2026-06-17 13:14:43 +09:00
Sukchan Lee
ed660b1b15 gtp: update TLV definitions to Rel-19
Regenerate GTPv1 and GTPv2 TLV message definitions from the latest
Release 19 3GPP specifications.

For GTPv1, update the generator and regenerate message definitions from
TS 29.060 V19.0.0. The generator now handles the unmodified Word document
without manual table-cell edits, including merged table cells and reference
values with suffixes such as 7.7.25A, 7.7.25B, and 7.7.45A.

For GTPv2, update the generator and regenerate message definitions from
TS 29.274 V19.6.0. This adds new Rel-19 IEs, updates changed message and
grouped IE definitions, and improves parsing of aliases such as APCO, LDN,
IP4CP, and PTI.

Also update the TLV regeneration documentation for GTPv1 and GTPv2.
2026-06-17 13:14:13 +09:00
Sukchan Lee
5333ad2bc2 pfcp: update TLV definitions to TS 29.244 R19.5.0
Regenerate PFCP message definitions from 3GPP TS 29.244 V19.5.0.

This updates PFCP IE and grouped IE definitions for Rel-19, including
new N6 delay measurement, protocol description, RTP information,
header handling, MPQUIC, and other newly added information elements.

It also updates renamed IEs and fixes generator handling for duplicated
IE names and repeated IE types in the same message or grouped IE.

Remove obsolete User Plane IP Resource Information handling from PFCP
messages. Since this IE is no longer present in the generated PFCP
Association messages, remove the remote PFCP node GTP-U resource list
and related encode/decode helpers. Local configured GTP-U resource
handling is kept for CH F-TEID allocation.
2026-06-17 10:05:16 +09:00
Sukchan Lee
7454637d04 pfcp: add Rel-19.5.0 TS 29.244 support document
Move the existing Rel-17.7.1 TS 29.244 support documents into
the r17.7.1 directory and add the Rel-19.5.0 version.
2026-06-17 10:05:01 +09:00
Matej Gradisar
631c366c4e [SMF] Fix use-after-free of h_smf_id in HR roaming V-SMF 2026-06-17 09:45:32 +09:00