From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FEC4C432C0 for ; Tue, 3 Dec 2019 22:55:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E398020863 for ; Tue, 3 Dec 2019 22:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413716; bh=A/Gyt4u7QrLQqefxIrkznJtIypsCEwCYUtwHl31T/So=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=im/+K0ityVDV3uXbJktE4u+TDLylNouQZ6VMKHCtqJ6fyPY0Dw9YZR+8H5pYg64VP Ncqgzp1+Hf0W/rAWGVwOLfthSTx6rIf9aGYtEzUuPJg65+BL/Hiewz3Kc+bhOX8Mhm 05bmg2pHp3AqEh9+BG5n0SJUpzSMT7G3PFeO2Efs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730259AbfLCWzO (ORCPT ); Tue, 3 Dec 2019 17:55:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:49322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730208AbfLCWzH (ORCPT ); Tue, 3 Dec 2019 17:55:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 593242053B; Tue, 3 Dec 2019 22:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413706; bh=A/Gyt4u7QrLQqefxIrkznJtIypsCEwCYUtwHl31T/So=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ovbfBS2pC+Lj7cyRQ5By+jgbmBnKuBgvla+2GnKDDxJMd+kSg0kgB/XfmSWV294+K EWoaNlwXn4WSS5GuDwZ/3yHkSAp2IGQmC5+XKVXr3lvkd1AZqoVjqVULuZpsrZJ+JJ +SKU9iZQtW5M8HsoaKty+EKR7dfMX3JFlAicyMu0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ying Xue , Jon Maloy , Hoang Le , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 231/321] tipc: fix skb may be leaky in tipc_link_input Date: Tue, 3 Dec 2019 23:34:57 +0100 Message-Id: <20191203223439.130939993@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hoang Le [ Upstream commit 7384b538d3aed2ed49d3575483d17aeee790fb06 ] When we free skb at tipc_data_input, we return a 'false' boolean. Then, skb passed to subcalling tipc_link_input in tipc_link_rcv, 1303 int tipc_link_rcv: ... 1354 if (!tipc_data_input(l, skb, l->inputq)) 1355 rc |= tipc_link_input(l, skb, l->inputq); Fix it by simple changing to a 'true' boolean when skb is being free-ed. Then, tipc_link_rcv will bypassed to subcalling tipc_link_input as above condition. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Hoang Le Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/tipc/link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tipc/link.c b/net/tipc/link.c index 6344aca4487b6..0fbf8ea18ce04 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1114,7 +1114,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb, default: pr_warn("Dropping received illegal msg type\n"); kfree_skb(skb); - return false; + return true; }; } -- 2.20.1