Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/31193 )
Change subject: osmo_pfcp_tool: make usable again
......................................................................
Patch Set 4:
(1 comment)
File src/osmo-pfcp-tool/pfcp_tool.h:
https://gerrit.osmocom.org/c/osmo-upf/+/31193/comment/649f0bde_2ee6f797
PS1, Line 92: #if 0
> why is this now commented out?
sorry, was just wip cruft, gone now.
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/31193
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: I22cfaa4aedd465c81de85e673b9960eaf99c426b
Gerrit-Change-Number: 31193
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 10 Feb 2023 02:28:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31281 )
Change subject: PCU_Tests: use real values for c_BssgpCell{Mcc,Mnc}
......................................................................
PCU_Tests: use real values for c_BssgpCell{Mcc,Mnc}
There is no such country/operator with MCC=023/MNC=43. Wireshark
complains about that when looking at the BSSGP messahes:
Mobile Country Code (MCC): Unknown (23)
Mobile Network Code (MNC): Unknown (43)
This may look confusing, let's better use some real country/operator:
Mobile Country Code (MCC): Central African Rep. (623)
Mobile Network Code (MNC): Celca (Socatel) (03)
Change-Id: Idc22128657d10893aa5c6d8ec80538a764de5c42
Related: OS#5901
---
M pcu/PCU_Tests.ttcn
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/31281/1
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index 6e858d5..15ea195 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -5132,8 +5132,8 @@
return dl_block;
}
-private const GsmMcc c_BssgpCellMcc := '023'H;
-private const GsmMnc c_BssgpCellMnc := '43'H;
+private const GsmMcc c_BssgpCellMcc := '623'H; /* MCC: Central African Republic */
+private const GsmMnc c_BssgpCellMnc := '03'H; /* MNC: Celca (Socatel) */
private template (value) BssgpCellId ts_BssgpCellIdDstAddr_default := {
ra_id := {
lai := {
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31281
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Idc22128657d10893aa5c6d8ec80538a764de5c42
Gerrit-Change-Number: 31281
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31276 )
Change subject: Revert "library/GSM_Types: fix encoding of BcdMccMnc (3 octets)"
......................................................................
Revert "library/GSM_Types: fix encoding of BcdMccMnc (3 octets)"
This is a partial revert of e9858efb90a2997e2a54161d7b5213d8bac51b6e.
I was confused by weird MCC/MNC values in the Destination RAI generated
by the NACC testcases from the PCU_Tests.ttcn. As I figured out, these
values are not from the INFO.ind, but some hard-coded literals:
* SRC RAI: MCC=262/MNC=42/LAC=13135/RAC=0 (from ts_PCUIF_INFO_default);
* DST RAI: MCC=023/MNC=43/LAC=00423/RAC=2 (resolved by test itself);
so actually they're not incorrect: they're sent by the testsuite itself
in response to the Neighbor Address Resolution Request, and then
expected to be received in the Destination RAI from the PCU.
Another important point is that TITAN produces different results when:
a) converting BcdMccMnc to bytes using the hex2oct() function,
b) converting BcdMccMnc to bytes using the RAW encoder.
The key difference is that TITAN does swap nibbles in each byte when
using the RAW encoder, but does not when using the hex2oct() function.
Use the proper hexorder (low-to-high) in f_enc_BcdMccMnc().
Add a selftest to make sure we're encoding the input properly.
This change makes the NACC testcases pass again.
Change-Id: I6f497b97c4f1e270803e01530be8355beea740bb
Related: SYS#5602
Fixes: OS#5901
---
M library/GSM_Types.ttcn
1 file changed, 21 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/31276/1
diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn
index 134edbd..0068cb8 100644
--- a/library/GSM_Types.ttcn
+++ b/library/GSM_Types.ttcn
@@ -443,8 +443,11 @@
/* 3GPP TS 24.008, Figure 10.5.13
* | MCC digit 2 | MCC digit 1 | octet 1
* | MNC digit 3 | MCC digit 3 | octet 2
- * | MNC digit 2 | MNC digit 1 | octet 3 */
- return mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0];
+ * | MNC digit 2 | MNC digit 1 | octet 3
+ *
+ * NOTE: TITAN takes care of swapping the nibbles in octets,
+ * so we use the normal (low-to-high) ordering here. */
+ return mcc[0] & mcc[1] & mcc[2] & mnc[2] & mnc[0] & mnc[1];
}
/* Compute BcdMccMnc from integer values */
@@ -460,6 +463,22 @@
}
}
+testcase TC_selftest_enc_BcdMccMnc() runs on Dummy_CT {
+ if (not match('62F224'O, decmatch BcdMccMnc:'262F42'H)) { setverdict(fail); }
+ if (not match('21F354'O, decmatch BcdMccMnc:'123F45'H)) { setverdict(fail); }
+ if (not match('216354'O, decmatch BcdMccMnc:'123645'H)) { setverdict(fail); }
+
+ if (not match(f_enc_BcdMccMnc('262'H, '42'H), BcdMccMnc:'262F42'H)) { setverdict(fail); }
+ if (not match(f_enc_BcdMccMnc('123'H, '45'H), BcdMccMnc:'123F45'H)) { setverdict(fail); }
+ if (not match(f_enc_BcdMccMnc('123'H, '456'H), BcdMccMnc:'123645'H)) { setverdict(fail); }
+
+ if (not match(f_enc_BcdMccMnc_int(262, 42, false), BcdMccMnc:'262F42'H)) { setverdict(fail); }
+ if (not match(f_enc_BcdMccMnc_int(123, 45, false), BcdMccMnc:'123F45'H)) { setverdict(fail); }
+ if (not match(f_enc_BcdMccMnc_int(123, 456, true), BcdMccMnc:'123645'H)) { setverdict(fail); }
+
+ setverdict(pass);
+}
+
/* 24.008 10.5.1.3 */
type record LocationAreaIdentification {
BcdMccMnc mcc_mnc,
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31276
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6f497b97c4f1e270803e01530be8355beea740bb
Gerrit-Change-Number: 31276
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31275 )
Change subject: pcu/osmo-pcu.cfg: use the PCUIF for neighbor resolution
......................................................................
pcu/osmo-pcu.cfg: use the PCUIF for neighbor resolution
This config is out of sync with the one in docker-playground.git.
The 'neighbor resolution' param makes osmo-pcu use the CTRL interface.
Change-Id: I8d59096644afd5a5278bc7bb1335670edad72576
Related: OS#5901
---
M pcu/osmo-pcu.cfg
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/75/31275/1
diff --git a/pcu/osmo-pcu.cfg b/pcu/osmo-pcu.cfg
index f33dfd8..68ea521 100644
--- a/pcu/osmo-pcu.cfg
+++ b/pcu/osmo-pcu.cfg
@@ -31,6 +31,7 @@
alloc-algorithm dynamic
gamma 0
pcu-socket /tmp/pcu_bts
- neighbor resolution 127.0.0.1
+! By default, use the PCUIF for neighbor resolution
+! neighbor resolution 127.0.0.1
gsmtap-remote-host 127.0.0.1
gsmtap-category enable-all
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/31275
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I8d59096644afd5a5278bc7bb1335670edad72576
Gerrit-Change-Number: 31275
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/31260 )
Change subject: clarify API doc for osmo_pfcp_endpoint_tx()
......................................................................
clarify API doc for osmo_pfcp_endpoint_tx()
I recently discovered some use-after-free in osmo-upf by wrong API usage
of osmo_pfcp_endpoint_tx(). Highlight this pitfall in API doc.
Change-Id: I637e7bb5d1296b5ad8db8ab0b8151fdbb9e7be03
---
M src/libosmo-pfcp/pfcp_endpoint.c
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/libosmo-pfcp/pfcp_endpoint.c b/src/libosmo-pfcp/pfcp_endpoint.c
index 83a689f..7e08d8e 100644
--- a/src/libosmo-pfcp/pfcp_endpoint.c
+++ b/src/libosmo-pfcp/pfcp_endpoint.c
@@ -326,7 +326,12 @@
* Store the message in the local message queue for possible retransmissions.
* On success, return zero, and pass ownership of m to ep. ep deallocates m when all retransmissions are done / a reply
* has been received.
- * On error, return nonzero, and immediately deallocate m. */
+ * On error, return nonzero, and immediately deallocate m.
+ *
+ * WARNING: Do not access the osmo_pfcp_msg m after calling this function! In most cases, m will still remain allocated,
+ * and accessing it will work, but especially when an error occurs, m will be deallocated immediately. Hence, you will
+ * see no problem during normal successful operation, but your program will crash with use-after-free on any error!
+ */
int osmo_pfcp_endpoint_tx(struct osmo_pfcp_endpoint *ep, struct osmo_pfcp_msg *m)
{
struct osmo_pfcp_ie_node_id *node_id;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/31260
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: I637e7bb5d1296b5ad8db8ab0b8151fdbb9e7be03
Gerrit-Change-Number: 31260
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged