dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/43957?usp=email )
Change subject: gprs_sndcp_xid: use reasonable static buffer size
......................................................................
gprs_sndcp_xid: use reasonable static buffer size
the output of gprs_sndcp_compile_xid is a buffer with TLV objects.
Each TLV object is generated into an internal buffer (comp_bytes)
before it is added to the output buffer using tlv_put. Since we
are using a TLV structure here, the fields cannot exceed a length
of 255. Using a buffer size of 512 is misleading.
Related: OS#7095
Change-Id: If348e15a98fd6d28a1de08df57983bb710001d73
---
M src/sgsn/gprs_sndcp_xid.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/57/43957/1
diff --git a/src/sgsn/gprs_sndcp_xid.c b/src/sgsn/gprs_sndcp_xid.c
index 0b981b5..834d98a 100644
--- a/src/sgsn/gprs_sndcp_xid.c
+++ b/src/sgsn/gprs_sndcp_xid.c
@@ -566,7 +566,7 @@
{
int rc;
int byte_counter = 0;
- uint8_t comp_bytes[512];
+ uint8_t comp_bytes[256];
uint8_t xid_version_number[1];
OSMO_ASSERT(comp_fields);
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/43957?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: If348e15a98fd6d28a1de08df57983bb710001d73
Gerrit-Change-Number: 43957
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: fixeria, lynxis lazus.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/43953?usp=email )
Change subject: gprs_sndcp_xid: fix length check in gprs_sndcp_compile_xid
......................................................................
Patch Set 2:
(2 comments)
File src/sgsn/gprs_sndcp_xid.c:
https://gerrit.osmocom.org/c/osmo-sgsn/+/43953/comment/373d8ed1_168d20ce?us… :
PS1, Line 596: VTVLV_GAN_GROSS_LEN
> Any reason to use GAN specific macros here? Why not plain `TLV_GROSS_LEN`?
I was a bit of track here, it's of course TVLV_GROSS_LEN, we also cannot
have comp_bytes results larger than 255 bytes then. The buffer size of
512 is a bit misleading here. I was assuming that we have length fields
with variable length here, but we don't...
https://gerrit.osmocom.org/c/osmo-sgsn/+/43953/comment/c2028603_f46e05ad?us… :
PS1, Line 609: SNDCP_XID_DATA_COMPRESSION
> ```suggestion […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/43953?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I977946a036f96d4dee2656bef048e2618198db40
Gerrit-Change-Number: 43953
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Comment-Date: Thu, 22 Oct 2026 13:56:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, lynxis lazus.
Hello Jenkins Builder, lynxis lazus,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/43953?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: gprs_sndcp_xid: fix length check in gprs_sndcp_compile_xid
......................................................................
gprs_sndcp_xid: fix length check in gprs_sndcp_compile_xid
The function gprs_sndcp_compile_xid gets an output buffer (dst) and
a length (dst_maxlen), but unfortunately, the length is not checked
before data is written to the output buffer (tlv_put).
The problem was reported by osmocom.org user tsato
(see related ticket)
Related: OS#7095
Change-Id: I977946a036f96d4dee2656bef048e2618198db40
---
M src/sgsn/gprs_sndcp_xid.c
M tests/sndcp_xid/sndcp_xid_test.c
M tests/sndcp_xid/sndcp_xid_test.ok
3 files changed, 41 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/53/43953/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/43953?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I977946a036f96d4dee2656bef048e2618198db40
Gerrit-Change-Number: 43953
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>