aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2016-11-23 23:46:09 -0500
committerDavid S. Miller <davem@davemloft.net>2016-11-25 20:06:18 -0500
commitd876a4d2afecacf4b4d8b11479e9f1ed0080bb2e (patch)
tree8df786914fd2f598c2bb2b7f4da4984872c160b5 /net/tipc
parentf79675563a6bbfc2ff85684bbbaea9ef092664d2 (diff)
tipc: improve sanity check for received domain records
In commit 35c55c9877f8 ("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: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/monitor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c
index ed97a5876ebe..9e109bb1a207 100644
--- a/net/tipc/monitor.c
+++ b/net/tipc/monitor.c
@@ -455,14 +455,14 @@ void tipc_mon_rcv(struct net *net, void *data, u16 dlen, u32 addr,
455 int i, applied_bef; 455 int i, applied_bef;
456 456
457 state->probing = false; 457 state->probing = false;
458 if (!dlen)
459 return;
460 458
461 /* Sanity check received domain record */ 459 /* Sanity check received domain record */
462 if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen) { 460 if (dlen < dom_rec_len(arrv_dom, 0))
463 pr_warn_ratelimited("Received illegal domain record\n"); 461 return;
462 if (dlen != dom_rec_len(arrv_dom, new_member_cnt))
463 return;
464 if ((dlen < new_dlen) || ntohs(arrv_dom->len) != new_dlen)
464 return; 465 return;
465 }
466 466
467 /* Synch generation numbers with peer if link just came up */ 467 /* Synch generation numbers with peer if link just came up */
468 if (!state->synched) { 468 if (!state->synched) {