Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp293288rwb; Thu, 11 Aug 2022 01:21:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR52H/AKuO7a/QH1aS9E0VVlzt4/7r3Hr/MnkUlH5t9GU0yDTFpMH5+hBPDEmN/rraOvwOSL X-Received: by 2002:a17:907:1dc3:b0:730:e866:35e with SMTP id og3-20020a1709071dc300b00730e866035emr20189994ejc.414.1660206075959; Thu, 11 Aug 2022 01:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660206075; cv=none; d=google.com; s=arc-20160816; b=XSLAefVza2qios9uUNp2VFESHE4W0V7zSqXFkpNbUvLccxpgZ5GzZzYo3qdegcMNIz f6IKZLyEW0ZyKYvlVPEYkQY3e1OE2dPzN/4uv/jBu6+Jl4n51dSHXvH+LXy2KFZrOKDv 4IWLPjK+YiDkqPCHCGo7M4Lv1VdU2kH43xhgTIp3FE+nttzYNS9xUIGPt8FsBw5GV1Ww Tly0Sk+DflyApaXfbWH2OHNFNLNcxiV76bi3POSDK/QnyMtUWRKpQtv5xSyVFOVuF0g+ lh87LJc3Rgss3qooCwDrI6e2F98PsMX8nn97syBhVvw6z7NysK4h4udgkgPNZXQ9oJOk e66A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xDa5LDC2OZSh8eP2hQRQmGnezW0BSLHEBttI1qvVfns=; b=EFKREDHpsMkpqnB5pb7augq/+/kFnIroqOSMdauBJqYTFyph8xBTvw4PPz9ooE4UCv lSzwFGTbwRw94vsfW706I5ZtydwDWW8T8gg90J2ruA71L/QluO90ZYxJe6tBXXC4PSjv 0lDCndkk0a6Jv8dXZi4v1QYg4N+u8Mp+g7D3c8xIKZLnGFAB7QOwqHTegHeFzHQnN5UH qR6BaYplxAaD4zBHc4l4vCVLUgOou2CoDHe1CrzOynALbeSO2AgYfsbPTK/mYn4w9TJw 36SrkKDFvC/YBMGMq28Wq/QR+EnVeklMvzjJWkAmZimalBha1uHJBZOZqJWXO3W+9C69 +1sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b="XAQaIZ/l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11-20020a508e4b000000b0043cd07cb6e5si12776874edx.78.2022.08.11.01.20.50; Thu, 11 Aug 2022 01:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b="XAQaIZ/l"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234163AbiHKIEG (ORCPT + 99 others); Thu, 11 Aug 2022 04:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234156AbiHKIED (ORCPT ); Thu, 11 Aug 2022 04:04:03 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B87905005A for ; Thu, 11 Aug 2022 01:04:02 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id i14so32160797ejg.6 for ; Thu, 11 Aug 2022 01:04:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=xDa5LDC2OZSh8eP2hQRQmGnezW0BSLHEBttI1qvVfns=; b=XAQaIZ/lYM+J2Xmgb4OV59DbJa22/EL4euqT9xkG48SWklz/0K0yy22BGxpNihcFpw jZs+dnl0itp10y89pJENSspuIwl1xUHcp0080DnyYFMDKZmki/68Byu8xvz0uff56cG4 jpXAGMkNfUTuCtMosL9QmMQtqorASt5Om50s6/ENkxgCEJeaW8SXuHHVf8O6A/SwwogN p9lF0H7LC35z4s7NGVYJn+/lvh0pCvwHetLIjJR1DwDjNyjYde1j9cbJZDOR2DF9Jb52 Foofxhk9EwVaLjDqH2LYjRjn54cPwiOXPg3a1rEvu+jydul79vaEwKFn4agKRshRSDB+ ET8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=xDa5LDC2OZSh8eP2hQRQmGnezW0BSLHEBttI1qvVfns=; b=EdT8oSMZwTbX4Mg7uZ6AFq5i0HZ4jOykC64ziMKM01kttboLQe+Iw6XjFWY43H/xSi l4Hg5tCu6NBTvP4muwobHChk9YetLZEgYjBl0bKyl9u9F/i+ye7JK1LXhulEAI4jN44r NS6P9u5sOLUNsOr2tt0DCjXBIiB4+urJg4TKqUIfY85PP5J8aL7/zC4tDDKxlpTXe0sj o8ZDnKcamVHMI7TnKJyWtJd3Uy6OFFApU8eYw2TErfhKK0BB08V5jUqd8JFn7urkTYHr zWBig6IhD1vKpbNyY+6WweX6uAKGhSoVbxDGF8SPj6Il+qRH1DJ8C7oO723682DieECA yrvw== X-Gm-Message-State: ACgBeo0y4Y26hySvDgUM+8DtnRZDsY2y9hWrwnBh8ZxHlY/45jsttru/ W2CWUtKJ9gQ/AY/7msG3T9SK6g== X-Received: by 2002:a17:907:6288:b0:72f:90ba:f0b2 with SMTP id nd8-20020a170907628800b0072f90baf0b2mr21961452ejc.696.1660205041165; Thu, 11 Aug 2022 01:04:01 -0700 (PDT) Received: from [192.168.0.111] (87-243-81-1.ip.btc-net.bg. [87.243.81.1]) by smtp.gmail.com with ESMTPSA id la19-20020a170907781300b0072f0a9a8e6dsm3172157ejc.194.2022.08.11.01.04.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Aug 2022 01:04:00 -0700 (PDT) Message-ID: <251c1455-f30c-0130-2bb7-036d412a0516@blackwall.org> Date: Thu, 11 Aug 2022 11:03:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH net] bonding: fix reference count leak in balance-alb mode Content-Language: en-US To: Jay Vosburgh , netdev@vger.kernel.org, sunshouxin@chinatelecom.cn Cc: vfalico@gmail.com, andy@greyhouse.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, huyd12@chinatelecom.cn References: <26758.1660194413@famine> From: Nikolay Aleksandrov In-Reply-To: <26758.1660194413@famine> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/08/2022 08:06, Jay Vosburgh wrote: > Commit d5410ac7b0ba ("net:bonding:support balance-alb interface > with vlan to bridge") introduced a reference count leak by not releasing > the reference acquired by ip_dev_find(). Remedy this by insuring the > reference is released. > > Fixes: d5410ac7b0ba ("net:bonding:support balance-alb interface with vlan to bridge") > Signed-off-by: Jay Vosburgh > > --- > drivers/net/bonding/bond_alb.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c > index 60cb9a0225aa..b9dbad3a8af8 100644 > --- a/drivers/net/bonding/bond_alb.c > +++ b/drivers/net/bonding/bond_alb.c > @@ -668,8 +668,11 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) > > dev = ip_dev_find(dev_net(bond->dev), arp->ip_src); > if (dev) { > - if (netif_is_bridge_master(dev)) > + if (netif_is_bridge_master(dev)) { > + dev_put(dev); > return NULL; > + } > + dev_put(dev); > } > > if (arp->op_code == htons(ARPOP_REPLY)) { Nice catch, Reviewed-by: Nikolay Aleksandrov