Thanks to visit codestin.com
Credit goes to github.com

Skip to content

genl/qer: Only process MBR/GBR when all four attrs exist to avoid null access#153

Merged
tim-ywliu merged 1 commit intofree5gc:masterfrom
chen042531:fix/mbr-gbr-null-crash
Sep 12, 2025
Merged

genl/qer: Only process MBR/GBR when all four attrs exist to avoid null access#153
tim-ywliu merged 1 commit intofree5gc:masterfrom
chen042531:fix/mbr-gbr-null-crash

Conversation

@chen042531
Copy link
Contributor

Motivation

Netlink messages may omit some QER MBR/GBR attributes. Accessing mbr_param_attrs/gbr_param_attrs without verifying all expected fields risks null access.

Changes

  • Process MBR only if all of the following exist after successful nla_parse_nested:
    • GTP5G_QER_MBR_UL_HIGH32
    • GTP5G_QER_MBR_UL_LOW8
    • GTP5G_QER_MBR_DL_HIGH32
    • GTP5G_QER_MBR_DL_LOW8
  • Process GBR only if all of the following exist after successful nla_parse_nested:
    • GTP5G_QER_GBR_UL_HIGH32
    • GTP5G_QER_GBR_UL_LOW8
    • GTP5G_QER_GBR_DL_HIGH32
    • GTP5G_QER_GBR_DL_LOW8

Behavior Impact

  • If any required field is missing, MBR/GBR initialization is safely skipped (no crashes or null access).
  • When all fields are present, behavior is unchanged.

Affected Files

  • src/genl/genl_qer.c

@tim-ywliu tim-ywliu merged commit 7193719 into free5gc:master Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments