Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751884AbcLGILf (ORCPT ); Wed, 7 Dec 2016 03:11:35 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36590 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751134AbcLGILe (ORCPT ); Wed, 7 Dec 2016 03:11:34 -0500 From: Zhouyi Zhou To: , , , , , Cc: Zhouyi Zhou , Zhouyi Zhou Subject: [PATCH 1/1] tipc: return value of skb_linearize should be handled Date: Wed, 7 Dec 2016 16:11:07 +0800 Message-Id: <1481098267-25801-1-git-send-email-zhouzhouyi@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1317 Lines: 43 return value of skb_linearize should be handled Signed-off-by: Zhouyi Zhou Reviewed-by: Cong Wang Reviewed-by: Yuval Shaia Reviewed-by: Eric Dumazet --- net/tipc/link.c | 3 ++- net/tipc/name_distr.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index bda89bf..077c570 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1446,7 +1446,8 @@ static int tipc_link_proto_rcv(struct tipc_link *l, struct sk_buff *skb, if (tipc_own_addr(l->net) > msg_prevnode(hdr)) l->net_plane = msg_net_plane(hdr); - skb_linearize(skb); + if (skb_linearize(skb)) + goto exit; hdr = buf_msg(skb); data = msg_data(hdr); diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c index c1cfd92..4e05d2a 100644 --- a/net/tipc/name_distr.c +++ b/net/tipc/name_distr.c @@ -356,7 +356,10 @@ void tipc_named_rcv(struct net *net, struct sk_buff_head *inputq) spin_lock_bh(&tn->nametbl_lock); for (skb = skb_dequeue(inputq); skb; skb = skb_dequeue(inputq)) { - skb_linearize(skb); + if (skb_linearize(skb)) { + kfree_skb(skb); + continue; + } msg = buf_msg(skb); mtype = msg_type(msg); item = (struct distr_item *)msg_data(msg); -- 1.9.1