Commit 2716a5a3 authored by Guido Casati's avatar Guido Casati Committed by Guido Casati

RRCReestablishmentRequest: add PCI range validation

Add validation of physCellId against valid range (0-1007) per TS 38.331
specification. Invalid PCI values are now rejected early in the
reestablishment procedure.

This prevents processing of invalid reestablishment requests with
out-of-range PCI values, improving robustness and spec compliance.

Major changes:
- Add NR_PHYS_CELL_ID_MAX to common/platform_constants.h
- Add PCI range check in rrc_handle_RRCReestablishmentRequest() before
  cell lookup, returning early on invalid values
Signed-off-by: default avatarGuido Casati <guido.casati@openairinterface.org>
parent ede596cf
......@@ -55,6 +55,8 @@
/** Maximum number of Paging Occasions per Paging Frame (TS 38.331 PCCH-Config) */
#define NR_PCCH_MAX_PO 4
#define NR_PHYS_CELL_ID_MAX 1007 /* Maximum Physical Cell ID (0..1007) */
#define NB_RB_MBMS_MAX (29 * 16) /* 29 = LTE_maxSessionPerPMCH + 16 = LTE_maxServiceCount from LTE_asn_constant.h */
#define NB_RAB_MAX 11 /* from LTE_maxDRB in LTE_asn_constant.h */
......
......@@ -1451,6 +1451,12 @@ static void rrc_handle_RRCReestablishmentRequest(gNB_RRC_INST *rrc,
physCellId,
scause);
/* Validate PCI range per TS 38.331: PhysCellId (0..1007) */
if (physCellId < 0 || physCellId > NR_PHYS_CELL_ID_MAX) {
LOG_E(NR_RRC, "Invalid physCellId %ld (valid range: 0-%d), rejecting reestablishment request\n", physCellId, NR_PHYS_CELL_ID_MAX);
return;
}
const nr_rrc_du_container_t *du = get_du_by_assoc_id(rrc, assoc_id);
if (du == NULL) {
LOG_E(RRC, "received CCCH message, but no corresponding DU found\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment