Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amf): PDU-Session accept message coming with extra buffer causing failure of PDU-Session #13103

Merged
merged 4 commits into from Jul 7, 2022

Conversation

priya-wavelabs
Copy link
Contributor

@priya-wavelabs priya-wavelabs commented Jun 28, 2022

Signed-off-by: priya-wavelabs priya.agrawal@wavelabs.ai

Summary

PDU-Session accept message coming with extra buffer causing failure of PDU-Session . With other gnb simulators we are not seeing this issue.

Test Plan

Verified with unit test:
image

Basic sanity with ueransim.
Pcap:
image

MME Log:

mme_july_6.log

Additional Information

  • This change is backwards-breaking

@priya-wavelabs priya-wavelabs self-assigned this Jun 28, 2022
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines. label Jun 28, 2022
@github-actions
Copy link
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: agw Access gateway-related issue label Jun 28, 2022
}

dec_ret = aper_decode(
NULL, &asn_DEF_Ngap_NGAP_PDU, (void**) &pdu, bdata(raw), blength(raw),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void**>(...) instead [readability/casting] [4]

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2022

feg-workflow

    2 files  203 suites   39s ⏱️
374 tests 374 ✔️ 0 💤 0
388 runs  388 ✔️ 0 💤 0

Results for commit e81ad04.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2022

dp-workflow

18 tests   18 ✔️  5m 29s ⏱️
  2 suites    0 💤
  2 files      0

Results for commit e81ad04.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2022

agw-workflow

580 tests   576 ✔️  3m 50s ⏱️
    2 suites      4 💤
    2 files        0

Results for commit e81ad04.

♻️ This comment has been updated with latest results.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Jun 28, 2022
ngap_pdusession_setup_item_ies->pDUSessionResourceSetupRequestTransfer.buf =
(uint8_t*)calloc(er.encoded, sizeof(uint8_t));
(uint8_t*)calloc(((er.encoded + 7) >> 3), sizeof(uint8_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]


memcpy((void*)ngap_pdusession_setup_item_ies
->pDUSessionResourceSetupRequestTransfer.buf,
(void*)transfer->data, er.encoded);
(void*)transfer->data, blength(transfer));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void*>(...) instead [readability/casting] [4]

@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Jun 28, 2022
@priya-wavelabs priya-wavelabs marked this pull request as ready for review June 29, 2022 06:34
@priya-wavelabs priya-wavelabs requested review from a team and panyogesh June 29, 2022 06:34
Copy link
Contributor

@ganeshg87 ganeshg87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@priya-wavelabs priya-wavelabs added type: bug Something isn't working priority: medium Medium priority bug product: 5g sa labels Jun 29, 2022
… failure of PDU-Session

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines. and removed size/S Denotes a PR that changes 10-29 lines. labels Jul 7, 2022
session_context->pDUSessionResourceSetupRequestTransfer.buf =
(uint8_t*)calloc(er.encoded, sizeof(uint8_t));
(uint8_t*)calloc(((er.encoded + 7) >> 3), sizeof(uint8_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]


memcpy((void*)session_context->pDUSessionResourceSetupRequestTransfer.buf,
(void*)transfer->data, er.encoded);
(void*)transfer->data, blength(transfer));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void*>(...) instead [readability/casting] [4]

bstring transfer = blk2bstr(buffer, er.encoded);
&pduSessionResourceSetupRequestTransferIEs);
uint32_t encoded_bytes = NGAP_ASN_ENCODED_BYTES(er.encoded);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]

session_context->pDUSessionResourceSetupRequestTransfer.buf =
(uint8_t*)calloc(er.encoded, sizeof(uint8_t));
(uint8_t*)calloc(encoded_bytes, sizeof(uint8_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]

ngap_pdusession_setup_item_ies->pDUSessionResourceSetupRequestTransfer.buf =
(uint8_t*)calloc(er.encoded, sizeof(uint8_t));
(uint8_t*)calloc(encoded_bytes, sizeof(uint8_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Copy link
Contributor

@rsarwad rsarwad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explanation.
lgtm

Copy link
Contributor

@rsarwad rsarwad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@panyogesh
Copy link
Contributor

LGTM

@panyogesh panyogesh merged commit cac083b into magma:master Jul 7, 2022
emakeev pushed a commit to emakeev/magma that referenced this pull request Aug 5, 2022
… failure of PDU-Session (magma#13103)

* fix(amf): PDU-Session accept message coming with extra buffer causing failure of PDU-Session

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>

* Addressed review comments (R1)

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>

* Addressed review comments (R2)

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>

* Addressed review comments (R3)

Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: agw Access gateway-related issue priority: medium Medium priority bug product: 5g sa size/M Denotes a PR that changes 30-99 lines. type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants