Commit d876a4d2 authored by Jon Paul Maloy's avatar Jon Paul Maloy Committed by David S. Miller

tipc: improve sanity check for received domain records

In commit 35c55c98 ("tipc: add neighbor monitoring framework") we
added a data area to the link monitor STATE messages under the
assumption that previous versions did not use any such data area.

For versions older than Linux 4.3 this assumption is not correct. In
those version, all STATE messages sent out from a node inadvertently
contain a 16 byte data area containing a string; -a leftover from
previous RESET messages which were using this during the setup phase.
This string serves no purpose in STATE messages, and should no be there.

Unfortunately, this data area is delivered to the link monitor
framework, where a sanity check catches that it is not a correct domain
record, and drops it. It also issues a rate limited warning about the
event.

Since such events occur much more frequently than anticipated, we now
choose to remove the warning in order to not fill the kernel log with
useless contents. We also make the sanity check stricter, to further
reduce the risk that such data is inavertently admitted.
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f7967556
...@@ -455,14 +455,14 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr, ...@@ -455,14 +455,14 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
int i, applied_bef; int i, applied_bef;
state->probing = false; state->probing = false;
if (!dlen)
return;
/* Sanity check received domain record */ /* Sanity check received domain record */
if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen) { if (dlen < dom_rec_len(arrv_dom, 0))
pr_warn_ratelimited("Received illegal domain record\n"); return;
if (dlen != dom_rec_len(arrv_dom, new_member_cnt))
return;
if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen)
return; return;
}
/* Synch generation numbers with peer if link just came up */ /* Synch generation numbers with peer if link just came up */
if (!state->synched) { if (!state->synched) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment