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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05A5FC433EF for ; Mon, 6 Dec 2021 07:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238382AbhLFHUa (ORCPT ); Mon, 6 Dec 2021 02:20:30 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:40624 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238367AbhLFHU3 (ORCPT ); Mon, 6 Dec 2021 02:20:29 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DC57CB80FD4 for ; Mon, 6 Dec 2021 07:17:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE0F5C341C2; Mon, 6 Dec 2021 07:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638775019; bh=V8wVeVw3tN9o1lu8xgCQxndNZjjwpnhjNOQgUfPuEJo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cu9GnYbT3gZHCwkTgLbWWZ/cvw75bvRDa7kJg61+c4/JrDRdac9pr8csKuh7EdgsS VkZJQr9MMJVv18x9ZmsCxjO/IdgbIWQROamHbYAXBZTERdijbZypojCTutFFs+ZXYy cGflCkj5FH+TdSi6yPWAD4ZoW7I4o8K2Ctc0gFmeXLTmfT25qRI7rHrf4u/MzQdQN+ UjCIwz9zUgxYjOcJawOwgkc3PTKo0Qkwcbl+MvA4iCBxxIajc9yvxduzpvPK6kvniU Qz28cWXedemR55QS3bueXPHkgA42jxGLXIYvrh7sbYrtqSYtJ5LGHic/htyY1+gyI2 An0BQYVw3Ni8Q== Date: Mon, 6 Dec 2021 09:16:55 +0200 From: Leon Romanovsky To: Eric Dumazet Cc: "David S . Miller" , Jakub Kicinski , netdev , Eric Dumazet , Moshe Shemesh , Jacob Keller , Jiri Pirko Subject: Re: [PATCH net] devlink: fix netns refcount leak in devlink_nl_cmd_reload() Message-ID: References: <20211205192822.1741045-1-eric.dumazet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211205192822.1741045-1-eric.dumazet@gmail.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Dec 05, 2021 at 11:28:22AM -0800, Eric Dumazet wrote: > From: Eric Dumazet > > While preparing my patch series adding netns refcount tracking, > I spotted bugs in devlink_nl_cmd_reload() > > Some error paths forgot to release a refcount on a netns. > > To fix this, we can reduce the scope of get_net()/put_net() > section around the call to devlink_reload(). > > Fixes: ccdf07219da6 ("devlink: Add reload action option to devlink reload command") > Fixes: dc64cc7c6310 ("devlink: Add devlink reload limit option") > Signed-off-by: Eric Dumazet > Cc: Moshe Shemesh > Cc: Jakub Kicinski > Cc: Jacob Keller > Cc: Jiri Pirko > --- > net/core/devlink.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky