diff options
author | Harald Welte <laforge@osmocom.org> | 2019-10-19 12:24:31 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-10-19 12:24:55 +0200 |
commit | 959c90492ffd284851e747414f966f8af3ecda05 (patch) | |
tree | 29f0924d7dcc910e6afce2a5725a5199e544a1bc | |
parent | 6f7587eff176777f0780d5e9f6bbf91dbf7aa08c (diff) |
ipa: Don't send non-SCCP data over IPA/SCCPlite
The IPA/SCCPlite stacking is - as the name implies - constrained to
the transport of SCCP messages. We have to reject any non-SCCP payload.
Change-Id: I5e5a2879013ee8cf08aa4199b4bee498dcb61446
Fixes: OS#4235
-rw-r--r-- | src/ipa.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -57,6 +57,7 @@ int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua) { struct xua_msg_part *data_ie; + struct m3ua_data_hdr *data_hdr; struct msgb *msg; unsigned int src_len; const uint8_t *src; @@ -68,6 +69,13 @@ int ipa_tx_xua_as(struct osmo_ss7_as *as, struct xua_msg *xua) data_ie = xua_msg_find_tag(xua, M3UA_IEI_PROT_DATA); if (!data_ie || data_ie->len < sizeof(struct m3ua_data_hdr)) return -1; + data_hdr = (struct m3ua_data_hdr *) data_ie->dat; + + if (data_hdr->si != MTP_SI_SCCP) { + LOGPAS(as, DLSS7, LOGL_ERROR, "Cannot transmit non-SCCP SI (%u) to IPA peer\n", + data_hdr->si); + return -1; + } /* and even the data part still has the header prepended */ src = data_ie->dat + sizeof(struct m3ua_data_hdr); |