gnbsim
gnbsim copied to clipboard
gNBSim crashes upon receiving NAS Configuration update command
After UE registration, if the core network sends a NAS PDU with Message type: Configuration update command (0x54), gNBSim process crashes with a fatal error. Packet capture and gNBSim logs: gnbsim54.zip
The offending packet was generated by Open5GCore and looks like this:
NG Application Protocol (DownlinkNASTransport)
NGAP-PDU: initiatingMessage (0)
initiatingMessage
procedureCode: id-DownlinkNASTransport (4)
criticality: ignore (1)
value
DownlinkNASTransport
protocolIEs: 3 items
Item 0: id-AMF-UE-NGAP-ID
Item 1: id-RAN-UE-NGAP-ID
Item 2: id-NAS-PDU
ProtocolIE-Field
id: id-NAS-PDU (38)
criticality: reject (0)
value
NAS-PDU: 7e0232960dbd027e0054431510004f00700065006e003500470063006f00720065450910006f0035004700634742105241529000
Non-Access-Stratum 5GS (NAS)PDU
Security protected NAS 5GS message
Plain NAS 5GS Message
Extended protocol discriminator: 5G mobility management messages (126)
0000 .... = Spare Half Octet: 0
.... 0000 = Security header type: Plain NAS message, not security protected (0)
Message type: Configuration update command (0x54)
Network Name - Full name for network
Network Name - Short Name
Time Zone and Time - Universal Time and Local Time Zone
gNBSim log: (84 is decimal of 0x54)
time="2024-01-25T14:25:09Z" level=info msg="Received Message Type: 84" category=RealUe component=GNBSIM supi=imsi-001017005551000
time="2024-01-25T14:25:09Z" level=fatal msg="Invalid Event ID: 0x2000054" category=App component=GNBSIM
Thanks for nice bug report @yoursunny . I shall provide the fix, but due to lack of setup I may not be able to verify it. But please expect some update in coming days.
https://github.com/omec-project/gnbsim/blob/0cca26603b562d13f830dccf5c24f40201e5b861/common/events.go#L245
replace with Panicf
maybe ok
Fatalf
will call Logger.Exit(1)
This issue has been stale for 30 days and will be closed in 5 days. Comment to keep it open.
https://fvsch.com/stale-bots
Let us keep this open and we should see how we can reproduce this and identify possible solution. Thanks.
Let us keep this open and we should see how we can reproduce this and identify possible solution. Thanks.
Hi @thakurajayL, the crash is because "Configuration update command" (0x54) is not currently handled in gNBSim
(https://github.com/omec-project/gnbsim/blob/main/common/events.go#L106) and if message is not handled gNBSim
crashes due to logger.AppLog.Fatalf("Invalid Event ID: %#v", id)
(https://github.com/omec-project/gnbsim/blob/main/common/events.go#L245)
@thakurajayL, FYI, I still need to open a PR to update the "days before mark/close" in the Stale action to increase it as agreed on the TST. I have been running a few tests before making the change/update
It seems that free5GC v3.4.1 is also sending NAS Configuration update command. Therefore, gNBSim is no longer compatible with free5GC.
When this is planned to be addressed?
Can you uuse this one and see if it does not crash - https://github.com/omec-project/gnbsim/pull/164 ?
I need to add code to send response as well.
close by #164