From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shards.monkeyblade.net ([184.105.139.130]:39572 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752059AbeCHQUs (ORCPT ); Thu, 8 Mar 2018 11:20:48 -0500 Date: Thu, 08 Mar 2018 11:20:46 -0500 (EST) Message-Id: <20180308.112046.774311225172290117.davem@davemloft.net> To: arkadis@mellanox.com Cc: netdev@vger.kernel.org, mlxsw@mellanox.com, jiri@resnulli.us Subject: Re: [PATCH net] team: Fix double free in error path From: David Miller In-Reply-To: <1520505730-48057-1-git-send-email-arkadis@mellanox.com> References: <1520505730-48057-1-git-send-email-arkadis@mellanox.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: From: Arkadi Sharshevsky Date: Thu, 8 Mar 2018 12:42:10 +0200 > The __send_and_alloc_skb() receives a skb ptr as a parameter but in > case it fails the skb is not valid: > - Send failed and released the skb internally. > - Allocation failed. > > The current code tries to release the skb in case of failure which > causes redundant freeing. > > Fixes: 9b00cf2d1024 ("team: implement multipart netlink messages for options transfers") > Signed-off-by: Arkadi Sharshevsky > Acked-by: Jiri Pirko Indeed, all of the team send functions call down into either multicast or unicast netlink sends, which either free or consume the SKB. Applied and queued up for -stable, thanks.