Attention is currently required from: theenbyperor.
lynxis lazus has posted comments on this change by theenbyperor. ( https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/43092?usp=email )
Change subject: Set Item-Number in UTRAN and GERAN vectors.
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo_dia2gsup/+/43092?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo_dia2gsup
Gerrit-Branch: master
Gerrit-Change-Id: I75da04b806f23452c9b4cfaad0446dceb32a0369
Gerrit-Change-Number: 43092
Gerrit-PatchSet: 2
Gerrit-Owner: theenbyperor <q(a)magicalcodewit.ch>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: theenbyperor <q(a)magicalcodewit.ch>
Gerrit-Comment-Date: Sat, 08 Aug 2026 10:46:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
n0k0 has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-bsc/+/43188?usp=email )
Change subject: ipaccess-proxy: reject short IPA header
......................................................................
ipaccess-proxy: reject short IPA header
recv() of the 3-byte IPA header can return fewer than 3 bytes on a
stream socket. ipaccess_proxy_read_msg() only handles ret < 0 and
ret == 0, so a short read falls through: msgb_put() advances msg->tail
by 'ret' while msg->l2h is set to msg->data + sizeof(*hh). The frame
length is then validated against msgb_tailroom() (measured from
msg->tail), so the subsequent body recv() into msg->l2h can write up to
sizeof(*hh) - ret bytes past the msgb.
Reject a short header, the same way handle_udp_read() already does.
Change-Id: I3043cccd110db19984f47916c269a4c59f82b08b
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/88/43188/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/43188?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3043cccd110db19984f47916c269a4c59f82b08b
Gerrit-Change-Number: 43188
Gerrit-PatchSet: 2
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>
n0k0 has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/43188?usp=email )
Change subject: ipaccess-proxy: reject short IPA header in ipaccess_proxy_read_msg
......................................................................
ipaccess-proxy: reject short IPA header in ipaccess_proxy_read_msg
recv() of the 3-byte IPA header can return fewer than 3 bytes on a
stream socket. ipaccess_proxy_read_msg() only handles ret < 0 and
ret == 0, so a short read falls through: msgb_put() advances msg->tail
by 'ret' while msg->l2h is set to msg->data + sizeof(*hh). The frame
length is then validated against msgb_tailroom() (measured from
msg->tail), so the subsequent body recv() into msg->l2h can write up to
sizeof(*hh) - ret bytes past the msgb.
Reject a short header, the same way handle_udp_read() already does.
Change-Id: I3043cccd110db19984f47916c269a4c59f82b08b
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/88/43188/1
diff --git a/src/ipaccess/ipaccess-proxy.c b/src/ipaccess/ipaccess-proxy.c
index 71190f6..b1c500c 100644
--- a/src/ipaccess/ipaccess-proxy.c
+++ b/src/ipaccess/ipaccess-proxy.c
@@ -576,6 +576,16 @@
msgb_free(msg);
*error = ret;
return NULL;
+ } else if (ret < sizeof(*hh)) {
+ /* A short (split) IPA header would leave msg->l2h (msg->data +
+ * sizeof(*hh)) ahead of msg->tail, while the frame length below is
+ * validated against msgb_tailroom() measured from msg->tail; the
+ * body recv() could then write up to sizeof(*hh) - ret bytes past
+ * the buffer. Reject it, like the other IPA read paths do. */
+ LOGP(DLINP, LOGL_ERROR, "short read of IPA header (%d)\n", ret);
+ msgb_free(msg);
+ *error = -EIO;
+ return NULL;
}
msgb_put(msg, ret);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/43188?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3043cccd110db19984f47916c269a4c59f82b08b
Gerrit-Change-Number: 43188
Gerrit-PatchSet: 1
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>
Attention is currently required from: fixeria, n0k0.
Hello Jenkins Builder, fixeria, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/42886?usp=email
to look at the new patch set (#5).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: ipaccess-proxy: reject oversized IPA frame length
......................................................................
ipaccess-proxy: reject oversized IPA frame length
ipaccess_proxy_read_msg() reads the 16-bit IPA frame length from the
wire header and passes it straight as the recv() count into a msgb that
was allocated with a fixed PROXY_ALLOC_SIZE (1200) bytes, without ever
checking it against the buffer tailroom. A peer that advertises a body
length larger than the remaining buffer space makes recv() write past
the end of the heap allocation (heap buffer overflow).
Reject frames whose advertised length exceeds the msgb tailroom, the
same way the other IPA read paths bound the read to msgb_tailroom().
This issue has been assigned the CVE candidate identifier
CAN-2026-2051036.
Change-Id: I05137e114eaa99ff0e85eecccf7645c90945214f
---
M src/ipaccess/ipaccess-proxy.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/86/42886/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42886?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I05137e114eaa99ff0e85eecccf7645c90945214f
Gerrit-Change-Number: 42886
Gerrit-PatchSet: 5
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: n0k0 <osmocom(a)hacky.software>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Attention is currently required from: fixeria, n0k0.
pespin has posted comments on this change by n0k0. ( https://gerrit.osmocom.org/c/osmo-bsc/+/42886?usp=email )
Change subject: ipaccess-proxy: reject oversized IPA frame length
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
Please actually break this into 2 patches, you added an unrelated problem/change in the new version.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/42886?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I05137e114eaa99ff0e85eecccf7645c90945214f
Gerrit-Change-Number: 42886
Gerrit-PatchSet: 4
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: n0k0 <osmocom(a)hacky.software>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 07 Aug 2026 20:49:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
n0k0 has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/43187?usp=email )
Change subject: gtp: clamp GSN-Address copy to sockaddr_in size
......................................................................
gtp: clamp GSN-Address copy to sockaddr_in size
gtp_data_req() builds an IPv4 destination sockaddr_in and does
memcpy(&addr.sin_addr, pdp->gsnru.v, pdp->gsnru.l); gtp_gpdu_ind()
checks the GPDU source with memcmp(&peer->sin_addr, pdp->gsnru.v,
pdp->gsnru.l). Both use the wire GSN-Address length as the count into
the 4-byte sin_addr, so a GSN-Address longer than 4 bytes (e.g. a
16-byte IPv6 address) writes up to 4 bytes past the sockaddr_in on the
stack, or reads up to 12 bytes past sin_addr. Both sites already carried
a 'TODO range check' comment.
This is the AF_INET user-plane path, where the GSN address is a 4-byte
IPv4 address, so copy and compare exactly sizeof(sin_addr) bytes.
Change-Id: If49f1929645c0ba8d19f3c9aa95f57d0a432ad53
---
M gtp/gtp.c
1 file changed, 8 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/87/43187/1
diff --git a/gtp/gtp.c b/gtp/gtp.c
index fa65575..7a439d9 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -3280,7 +3280,10 @@
}
/* If the GPDU was not from the peer GSN tell him to delete context */
- if (memcmp(&peer->sin_addr, pdp->gsnru.v, pdp->gsnru.l)) { /* TODO Range? */
+ /* Compare only the IPv4 address bytes; peer->sin_addr is 4 bytes, so
+ * bound the compare to sizeof(sin_addr) rather than the (attacker-influenced)
+ * gsnru length to avoid reading past sin_addr. */
+ if (memcmp(&peer->sin_addr, pdp->gsnru.v, sizeof(peer->sin_addr))) {
rate_ctr_inc2(gsn->ctrg, GSN_CTR_ERR_UNKNOWN_PDP);
GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown GSN peer %s\n", inet_ntoa(peer->sin_addr));
return gtp_error_ind_resp(gsn, version, peer, fd, pack, len);
@@ -3778,7 +3781,10 @@
#if defined(__FreeBSD__) || defined(__APPLE__)
addr.sin_len = sizeof(addr);
#endif
- memcpy(&addr.sin_addr, pdp->gsnru.v, pdp->gsnru.l); /* TODO range check */
+ /* gsnru is the IPv4 GSN user-plane address for this AF_INET path; copy
+ * exactly sizeof(sin_addr) bytes so an over-long (e.g. 16-byte IPv6)
+ * address cannot write past addr on the stack. */
+ memcpy(&addr.sin_addr, pdp->gsnru.v, sizeof(addr.sin_addr));
/* prepare msghdr */
memset(&msgh, 0, sizeof(msgh));
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/43187?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: If49f1929645c0ba8d19f3c9aa95f57d0a432ad53
Gerrit-Change-Number: 43187
Gerrit-PatchSet: 1
Gerrit-Owner: n0k0 <osmocom(a)hacky.software>