summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2019-07-17 17:43:44 -0400
committerDavid S. Miller <davem@davemloft.net>2019-07-17 18:24:38 -0400
commit866e5fd8a7123444d865340ff21c1673f74cdecd (patch)
tree3fa4dbba90b1a0a2eea6f9fa63b3e722cd7adcbb
parent7b379472bc530fd9929f8791c4daffc63ca90e0c (diff)
tipc: initialize 'validated' field of received packets
The tipc_msg_validate() function leaves a boolean flag 'validated' in the validated buffer's control block, to avoid performing this action more than once. However, at reception of new packets, the position of this field may already have been set by lower layer protocols, so that the packet is erroneously perceived as already validated by TIPC. We fix this by initializing the said field to 'false' before performing the initial validation. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/node.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 324a1f91b394..3a5be1d7e572 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -1807,6 +1807,7 @@ void tipc_rcv(struct net *net, struct sk_buff *skb, struct tipc_bearer *b)
1807 __skb_queue_head_init(&xmitq); 1807 __skb_queue_head_init(&xmitq);
1808 1808
1809 /* Ensure message is well-formed before touching the header */ 1809 /* Ensure message is well-formed before touching the header */
1810 TIPC_SKB_CB(skb)->validated = false;
1810 if (unlikely(!tipc_msg_validate(&skb))) 1811 if (unlikely(!tipc_msg_validate(&skb)))
1811 goto discard; 1812 goto discard;
1812 hdr = buf_msg(skb); 1813 hdr = buf_msg(skb);