Skip to content

Key derivation and registration failure for ARM64 build #16

Description

@cwpatterson1

Hello,

I've come across a difference in behavior between a N3IWUE build for x86_64 and a build for ARM64. The x86 client successfully completes authentication and registration with the Free5GC core via the Free5GC N3IWF. The ARM client registration process fails after the AMF determines a failed integrity check ("NAS MAC verification failed") in the UE's response to the Security Mode Command message. The logs show that the core and the UE compute a different Kamf key. This is after authentication completes with RES* and XRES* matching accurately. The logs do not print out the subsequent keys until Kamf, so I'm guessing there is an issue somewhere in the key derivation process after CK and IK (Kausf, Kseaf, Kamf). Note that this behavior ONLY occurs on the ARM client - the x86 client works fine.

Some additional background:
5G Core:

  • Free5GC core and N3IWF, code tag v4.0.1
  • Ubuntu 24 server on x86 VM

N3IWUE:

  • Free5GC n3iwue, pulled from main branch at commit 7b268f9
  • Built for x86 client using Go version 1.22.2, tested on Ubuntu 24 server
  • Built for ARM64 client using Go version 1.22.2
    • Tested on Ubuntu 24 server (ARM64), Ubuntu 22 desktop (ARM64), and Android 14 (ARM64) root shell
    • All test environments showed the same behavior
    • ARM64 client was built using cross-compilation on x86 Ubuntu 24 machine, and native compilation on ARM64 Ubuntu 24 machine using the same version of Go and same codebase. Same behavior for both.
  • Using go list -m all the dependency versions of the x86 and ARM64 clients were the same.

Attached are the logs for the x86 and ARM64 clients, both the UE and the core sides. The K, Op, AMF, and SQN values are the same for the subscription entries between these two tests, only the IMSI is different. (Note that the ARM64 UE log format looks different from the x86 log, since it was taken from the actual log file instead of copying terminal text.)

n3ue_arm.log

n3iwue_arm_core.log

n3iwue_x86.log

n3iwue_x86_core.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions