Skip to content

fix(mme): [S1 handover] fix bugs in security context for HandoverRequest Msg#7985

Merged
ulaskozat merged 1 commit intomagma:masterfrom
talkhasib:s1ho_fix
Jul 12, 2021
Merged

fix(mme): [S1 handover] fix bugs in security context for HandoverRequest Msg#7985
ulaskozat merged 1 commit intomagma:masterfrom
talkhasib:s1ho_fix

Conversation

@talkhasib
Copy link
Copy Markdown
Contributor

Signed-off-by: Tariq Al-Khasib [email protected]

Summary

Security context next hop info were not properly computed or populated for HandoverRequest Msg. This PR resolves the following issues

1- A copy of emm_context was used to update next_hop and nhcc. These changes did not persist
2- We only copied 1 byte of the next_hop vector into the security context ie
3- We needed to bump the NHCC and next_hop before we copied into security context

The last point above needs investigation as noted with a comment on the code. We are either missing a bump to NHCC and next_hop somewhere else. Or this is the correct behaviour

Another place that needs investigation is the path switch msg for X2 handover as it populates a similar security context.

Test Plan

Tested on local setup with 2 baicells eNBs and a pixel3 phone
pcap is attached
S1HO_UE_Baicells.pcap.zip

@talkhasib talkhasib requested review from a team, ardzoht, shaddi and ulaskozat July 11, 2021 20:15
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines. label Jul 11, 2021
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for opening a PR! 💯 Please note that all commits must be signed off. This is enforced by the DCO check.

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

@magmabot magmabot added the component: agw Access gateway-related issue label Jul 11, 2021
Comment on lines +3337 to +3343

/* TODO: investigate
1- Should we bump next_hop and use it in this message (as is)
2- or, use the previously calculated next_hop and bump up for next
iteration. In this case, we are missing a bump to next_hop someewhere
else, per testing
*/
Copy link
Copy Markdown
Contributor

@ulaskozat ulaskozat Jul 12, 2021

Choose a reason for hiding this comment

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

TL;DR We should bump up next_hop and ncc, store these new values and send them to target eNB in S1 Handover Request.

Longer explanation:

https://www.etsi.org/deliver/etsi_ts/133400_133499/133401/15.07.00_60/ts_133401v150700p.pdf section 7.2.8.4.3 indicates that (source and target MMEs in this case are the same):

  • "Upon reception of the HANDOVER REQUIRED message the source MME shall increase its locally kept NCC value
    by one and compute a fresh NH from its stored data"
  • "The source MME shall store that fresh pair and send it to the target MME in the S10 FORWARD RELOCATION REQUEST message." (here S10 can be ignored as source and target MMEs are the same.
  • "The target MME shall store locally the {NH, NCC} pair received from the source MME.The target MME shall then send the received {NH, NCC} pair to the target eNB within the S1 HANDOVER REQUEST."

Copy link
Copy Markdown
Contributor

@ulaskozat ulaskozat left a comment

Choose a reason for hiding this comment

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

I think bump up behavior is correct as noted in my comment.

@talkhasib talkhasib added the ready2merge This PR is ready to be merged (is approved and passes all required checks) label Jul 12, 2021
@ulaskozat
Copy link
Copy Markdown
Contributor

@talkhasib Why is the context release command is going to enb with ip ending 245 but not to enab with 249 (the requester)?

Copy link
Copy Markdown
Contributor

@ulaskozat ulaskozat left a comment

Choose a reason for hiding this comment

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

Context release is ending up at the wrong eNB?

@talkhasib
Copy link
Copy Markdown
Contributor Author

talkhasib commented Jul 12, 2021

Context release is ending up at the wrong eNB?

Good catch
There is another issue, MME needs to send the release command to the source eNB once it gets the handover notify. We currently rely on the source eNB sending a release request.

I think these issues need to be addressed in a separate PR

@shaddi
Copy link
Copy Markdown
Contributor

shaddi commented Jul 12, 2021

Thank you for finally finding the fix for this. :-)

@ulaskozat
Copy link
Copy Markdown
Contributor

Context release is ending up at the wrong eNB?

Good catch
There is another issue, MME needs to send the release command to the source eNB once it gets the handover notify. We currently rely on the source eNB sending a release request.

I think these issues need to be addressed in a separate PR

Okay, then let me stamp it again and you can merge it. I assume you did run the integ tests on this locally?

Copy link
Copy Markdown
Contributor

@ulaskozat ulaskozat left a comment

Choose a reason for hiding this comment

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

LGTM. The remaining issues will be handled in a separate PR.

@talkhasib talkhasib added ready2merge This PR is ready to be merged (is approved and passes all required checks) and removed ready2merge This PR is ready to be merged (is approved and passes all required checks) labels Jul 12, 2021
@talkhasib talkhasib changed the title fix(mme)(s1_handover) fix bugs in security context for HandoverRequest Msg fix(mme): [S1 handover] fix bugs in security context for HandoverRequest Msg Jul 12, 2021
@ulaskozat ulaskozat merged commit d976d3b into magma:master Jul 12, 2021
uri200 pushed a commit to uri200/magma that referenced this pull request Jul 13, 2021
amarpad pushed a commit to amarpad/magma that referenced this pull request Jul 13, 2021
rmeleromira pushed a commit to rmeleromira/magma that referenced this pull request Jul 24, 2021
ulaskozat pushed a commit to ulaskozat/magma that referenced this pull request Aug 4, 2021
ulaskozat added a commit that referenced this pull request Aug 4, 2021
…t msg (#7985) (#8461)

Signed-off-by: Tariq Al-Khasib <[email protected]>

Co-authored-by: Tariq Al-Khasib <[email protected]>
ulaskozat pushed a commit to ulaskozat/magma that referenced this pull request Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported-v1.6 component: agw Access gateway-related issue ready2merge This PR is ready to be merged (is approved and passes all required checks) size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants