osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/43240?usp=email )
Change subject: scripts/update-osmo-ci: rename from contrib/jenkins.sh
......................................................................
scripts/update-osmo-ci: rename from contrib/jenkins.sh
In all other Osmocom repositories, the contrib/jenkins.sh is the script
we run in gerrit-verifications. Here we had such a script as well, but
it was for a different purpose, to update osmo-ci, osmo-gsm-manuals
repos on jenkins nodes and rebuild docker images, triggered by the
update-osmo-ci job. Rename the script to avoid confusion and to prepare
to add a script for running in gerrit-verifications.
Change-Id: Ie9793663aa9b60683fc78c738b550913e8f01fbb
---
M jobs/update-osmo-ci-on-slaves.yml
R scripts/update-osmo-ci/update-osmo-ci.sh
2 files changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/40/43240/1
diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml
index 9abefa9..f05c21c 100644
--- a/jobs/update-osmo-ci-on-slaves.yml
+++ b/jobs/update-osmo-ci-on-slaves.yml
@@ -47,7 +47,7 @@
- timed: "H H * * *"
builders:
- - shell: './contrib/jenkins.sh'
+ - shell: './scripts/update-osmo-ci/update-osmo-ci.sh'
wrappers:
- ansicolor:
diff --git a/contrib/jenkins.sh b/scripts/update-osmo-ci/update-osmo-ci.sh
similarity index 100%
rename from contrib/jenkins.sh
rename to scripts/update-osmo-ci/update-osmo-ci.sh
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/43240?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ie9793663aa9b60683fc78c738b550913e8f01fbb
Gerrit-Change-Number: 43240
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Attention is currently required from: dexter, laforge.
pespin has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-msc/+/43229?usp=email )
Change subject: sgs_iface: guard against over-long MME name IEs.
......................................................................
Patch Set 3:
(1 comment)
File src/libmsc/sgs_iface.c:
https://gerrit.osmocom.org/c/osmo-msc/+/43229/comment/5190703a_475ac475?usp… :
PS2, Line 165: const uint8_t *mme_name_enc = TLVP_VAL_MINLEN(tp, SGSAP_IE_MME_NAME, SGS_MME_NAME_LEN);
> MME name is not some random DNS domain name, but a "fully qualified domain name (FQDN) as specified […]
Thanks, now it makes sense 😊
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9e845ad1568cb3a88c90f81655c30cac862f83ec
Gerrit-Change-Number: 43229
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 14 Aug 2026 07:45:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email )
Change subject: sgs_iface: clean up code in function decode_mme_name
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File src/libmsc/sgs_iface.c:
https://gerrit.osmocom.org/c/osmo-msc/+/43237/comment/90941969_6b55ee34?usp… :
PS1, Line 165: const uint8_t *mme_name_enc = TLVP_VAL_MINLEN(tp, SGSAP_IE_MME_NAME, SGS_MME_NAME_LEN);
> @espin: so is the TLV value actually expected to be at least SGS_MME_NAME_LEN? Is that correct? […]
MME name is not some random DNS domain name, but a "fully qualified
domain name (FQDN) as specified in subclause 19.4.2.1 of 3GPP TS 23.003"
- that's the *.mccXXX.mncYYY.3gppnetwork.org domain, and in that scheme
the length is known.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9aec8300f15264b68ac8e7805e93e621b12cafb2
Gerrit-Change-Number: 43237
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 14 Aug 2026 07:30:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: dexter, pespin.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-msc/+/43229?usp=email )
Change subject: sgs_iface: guard against over-long MME name IEs.
......................................................................
Patch Set 3: Code-Review+1
(1 comment)
File src/libmsc/sgs_iface.c:
https://gerrit.osmocom.org/c/osmo-msc/+/43229/comment/40b8b07b_2ee5cac4?usp… :
PS2, Line 165: const uint8_t *mme_name_enc = TLVP_VAL_MINLEN(tp, SGSAP_IE_MME_NAME, SGS_MME_NAME_LEN);
> Can you have a look at the newest version/release of the spec? What's the sense in it being exactly […]
MME name is not some random DNS domain name, but a "fully qualified domain name (FQDN) as specified in subclause 19.4.2.1 of 3GPP TS 23.003" - that's the *.mccXXX.mncYYY.3gppnetwork.org domain, and in that scheme the length is known.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43229?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9e845ad1568cb3a88c90f81655c30cac862f83ec
Gerrit-Change-Number: 43229
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 14 Aug 2026 07:09:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/43236?usp=email )
Change subject: bits: Fix osmo_pbit2ubit() reading extra input byte on num_bits%8==0
......................................................................
bits: Fix osmo_pbit2ubit() reading extra input byte on num_bits%8==0
For instance, if num_bits was 0, it would read in[0], which is
unexpected.
Related: OS#7052
Reported-By: Adam Bedard <adam.bedard(a)gmail.com>
Change-Id: I3ec32631440f3df48627eac3ec4cefae32ef7244
---
M src/core/bits.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/core/bits.c b/src/core/bits.c
index a4c0970..fc41d4a 100644
--- a/src/core/bits.c
+++ b/src/core/bits.c
@@ -148,7 +148,7 @@
ubit_t *cur = out;
ubit_t *limit = out + num_bits;
- for (i = 0; i < (num_bits/8)+1; i++) {
+ for (i = 0; i < ((num_bits + 7) / 8); i++) {
pbit_t byte = in[i];
*cur++ = (byte >> 7) & 1;
if (cur >= limit)
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43236?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I3ec32631440f3df48627eac3ec4cefae32ef7244
Gerrit-Change-Number: 43236
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/43234?usp=email )
Change subject: iuup: Avoid stack buffer-overflow rx IuUP with payload >1024 bytes
......................................................................
iuup: Avoid stack buffer-overflow rx IuUP with payload >1024 bytes
While verifying the IuUP payload CRC, osmo_pbit2ubit() is called where
an out buffer of fixed size is passed and written to.
Since there was no check validating the received IuUP payload would fit
in that buffer, it could happen that osmo_pbit2ubit() would write past
the stack buffer.
* Make sure the PDU payload size is validated to be smaller than the buf
* Increase a the buf size to 1500 to make sure all UDP/RTP/IuUP payloads
on regular ethernet frames can fit just well.
Related: OS#7052
Reported-By: Adam Bedard <adam.bedard(a)gmail.com>
Change-Id: Id71d3963649f8f711b1584daec3508951ebf462d
---
M src/core/bits.c
M src/gsm/iuup.c
2 files changed, 16 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/core/bits.c b/src/core/bits.c
index 8616d32..a4c0970 100644
--- a/src/core/bits.c
+++ b/src/core/bits.c
@@ -139,6 +139,8 @@
* \param[in] in input buffer of packed bits
* \param[in] num_bits number of bits
* \return number of bytes used in \ref out
+ *
+ * Note: size of out array is expected to be ">= num_bits" bytes.
*/
int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits)
{
diff --git a/src/gsm/iuup.c b/src/gsm/iuup.c
index 0952c5e..622302a 100644
--- a/src/gsm/iuup.c
+++ b/src/gsm/iuup.c
@@ -70,9 +70,12 @@
int osmo_iuup_compute_payload_crc(const uint8_t *iuup_pdu, unsigned int pdu_len)
{
- ubit_t buf[1024*8];
+ /* Assume no IuUP payloads bigger than a regular ethernet frame: */
+ const unsigned int max_supported_iuup_payload_len_bytes = 1500;
+ ubit_t buf[max_supported_iuup_payload_len_bytes * 8];
uint8_t pdu_type;
- int offset, payload_len_bytes;
+ int offset;
+ unsigned int payload_len_bytes;
if (pdu_len < 1)
return -1;
@@ -91,6 +94,11 @@
return -1;
payload_len_bytes = pdu_len - offset;
+
+ /* Guard against osmo_pbit2ubit writing past buf: */
+ if (payload_len_bytes > max_supported_iuup_payload_len_bytes)
+ return -1;
+
osmo_pbit2ubit(buf, iuup_pdu+offset, payload_len_bytes*8);
return osmo_crc16gen_compute_bits(&iuup_data_crc_code, buf, payload_len_bytes*8);
}
@@ -887,6 +895,8 @@
t0h = (struct iuup_pdutype0_hdr *) data;
payload_crc = ((uint16_t)t0h->payload_crc_hi << 8) | t0h->payload_crc_lo;
payload_crc_computed = osmo_iuup_compute_payload_crc(data, len);
+ if (payload_crc_computed < 0)
+ goto payload_crc_err;
if (payload_crc != payload_crc_computed)
goto payload_crc_err;
break;
@@ -901,6 +911,8 @@
if (t14h->ack_nack == IUUP_AN_PROCEDURE) {
payload_crc = ((uint16_t)t14h->payload_crc_hi << 8) | t14h->payload_crc_lo;
payload_crc_computed = osmo_iuup_compute_payload_crc(data, len);
+ if (payload_crc_computed < 0)
+ goto payload_crc_err;
if (payload_crc != payload_crc_computed)
goto payload_crc_err;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43234?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id71d3963649f8f711b1584daec3508951ebf462d
Gerrit-Change-Number: 43234
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
laforge has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/libosmocore/+/43238?usp=email )
Change subject: sim: fix APDU case detection for EMV commands under CLA=0x80
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I think the proper way to address this is not to "pollute" the ETSI UICC tables for CLA=0x80, but to create a separate table for EMV, listing only those commands that are specified within EMV (possibly with fallback to ISO 7816-4 as far as that is used in EMV), and then create a new osim_cla_ins_card_profile from that.
When tracing EMV cards, one would then have to use that profile instead of the SIM/UICC/USIM one for telecom cards.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43238?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6424397cb888f372fb44b4e984adf3ab8f4cd40b
Gerrit-Change-Number: 43238
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 14 Aug 2026 06:44:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/43238?usp=email )
Change subject: sim: fix APDU case detection for EMV commands under CLA=0x80
......................................................................
sim: fix APDU case detection for EMV commands under CLA=0x80
osim_determine_apdu_case() looks up uicc_ins_tbl_80 to classify APDUs,
which only covered SIM/UICC/GlobalPlatform instructions. Two gaps broke
real EMV contact transactions relayed through simtrace2-cardem-pcsc:
- GPO (0xA8) and GENERATE AC (0xAE) were missing entirely, causing
"FATAL: Unknown APDU case 0" and killing the cardem process mid
transaction.
- GET DATA (0xCA) fell through to gp_cla_ins_helper()'s P3==0 heuristic,
which misclassifies EMV's standard 6Cxx-retry pattern (retry has
P3 != 0) as case 4 instead of case 2, hanging on GET DATA 9F17 (PIN
Try Counter).
Adding explicit CLA=0x80 entries for these three instructions, checked
before the ambiguous GP heuristic, fixes both.
Change-Id: I6424397cb888f372fb44b4e984adf3ab8f4cd40b
---
M src/sim/class_tables.c
1 file changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/43238/1
diff --git a/src/sim/class_tables.c b/src/sim/class_tables.c
index 7500fc5..c510f73 100644
--- a/src/sim/class_tables.c
+++ b/src/sim/class_tables.c
@@ -238,6 +238,15 @@
[0x14] = 3, /* TERMINAL RESPONSE */
[0x76] = 4, /* SUSPEND UICC */
[0x7A] = 4, /* EXCHANGE CAPABILITIES */
+ /* EMV (Book 3, Table 3) proprietary CLA=0x80 commands, not covered by any ETSI/GP table */
+ [0xA8] = 4, /* GET PROCESSING OPTIONS */
+ [0xAE] = 4, /* GENERATE APPLICATION CRYPTOGRAM */
+ /* EMV GET DATA (Book 3, 6.5.7) is always case 2 (Le only, never Lc), unlike
+ * GlobalPlatform's overloaded 0xCA which gp_cla_ins_helper() disambiguates by
+ * P3==0 vs !=0 -- that heuristic misclassifies the standard EMV 6Cxx-retry
+ * pattern (first try Le=00, retry Le=<actual length>) as case 4. Matching here
+ * (exact CLA=0x80) takes priority over the broader 0xF0-masked GP entries. */
+ [0xCA] = 2, /* GET DATA */
};
/* Card Specification v2.3.1*/
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/43238?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6424397cb888f372fb44b4e984adf3ab8f4cd40b
Gerrit-Change-Number: 43238
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>