Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4603844imm; Sun, 22 Jul 2018 01:14:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfiobAiCPAzxjCnqRxVkxQB4GiP9EywVPkkh/Qd8PEOFf0Hl+qMkjYsR3RrU6SraxMfOpRy X-Received: by 2002:a63:1015:: with SMTP id f21-v6mr8089399pgl.354.1532247255285; Sun, 22 Jul 2018 01:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532247255; cv=none; d=google.com; s=arc-20160816; b=dbk6RYVEjqgrSREJi/G6Q+H5wJEFFyt3FWF4BWRp8Dcx8aGOCUfLiQ41vDe1LsYrYx PynRGGDDBzhqlFd0fTiTGMNTApkMTmATcrRfOQFAcKjBMEifMyog5xulEaXpnF2Mc/Ew xYDD5Og6RZKJ4CAZI52z1fKPGUgEllamE7Zmks/Ab07ZT+QJ4sMlWZmVwaO0ldGGhoeB 7MJQ08suzjwlMkfkgAVbFUUnJN+bIEj3EnP/z1k7THLOjXXo6QVZnEPNV7CDL3Z4qkq8 VnKkQPFxZYEvghu+3mpb1Kpd9YbSyjKeM0rWY2Gk+XL7bTaq67fTXg2p3tHzy4kB0fxI LHSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=M2rzk6SaqDDHthOXZU+ogCYiJHbsHid0HVcoHbib94Y=; b=u6RinIUxQ3FmNTmuQjo7bLiI/h8i3ZNCNzbFraqoM4r4Od+STwCCknMsb/EhD66DkQ My2Aj1rIdZy+79ajUekpYm29tpXaviRqTu/62VgZCBpCl6c7BrvMxFl2JIVIX8gATAJv njSxiW8WqFqtxww4wPdugVqCo10f+L28YwpJDyNZk+UxiUk7yjfqCtLPTxchOHG0VwEh n9TPxc2gVMDI0YsX1E3K3u3eRLcG/tROy3bdNB3QNkAsCO0H5D+M7k+lJKx7O5Q2A32f WUa93rt85Yqx+0U/eFVWg4qBL31b7m675KGho/da5U3+zaN2oyVhjgfrJtBmtWkifhI/ MdPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37-v6si5756762pgy.118.2018.07.22.01.14.00; Sun, 22 Jul 2018 01:14:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728203AbeGVJI7 (ORCPT + 99 others); Sun, 22 Jul 2018 05:08:59 -0400 Received: from Chamillionaire.breakpoint.cc ([146.0.238.67]:60988 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727962AbeGVJI7 (ORCPT ); Sun, 22 Jul 2018 05:08:59 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1fh9Ty-0000kI-F0; Sun, 22 Jul 2018 10:12:46 +0200 Date: Sun, 22 Jul 2018 10:12:46 +0200 From: Florian Westphal To: "Jason A. Donenfeld" Cc: cscnull@gmail.com, Pablo Neira Ayuso , kadlec@blackhole.kfki.hu, Florian Westphal , David Miller , "Berg, Johannes" , Philippe Ombredanne , kstewart@linuxfoundation.org, Greg Kroah-Hartman , dsahern@gmail.com, lucien.xin@gmail.com, ktkhai@virtuozzo.com, Cong Wang , LKML , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Netdev Subject: Re: [PATCH] netlink: fix memory leak Message-ID: <20180722081246.udphfijsnfnshrsc@breakpoint.cc> References: <20180722024925.3176-1-cscnull@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jason A. Donenfeld wrote: > On Sun, Jul 22, 2018 at 4:51 AM Shaochun Chen wrote: > But even if you moved it somehow to the if(ret), I'm still not sure > it'd be correct; start cbs should either succeed, or they should error > out and cleanup entirely after themselves. I agree, ->done() should not be called if cb->dump() was never invoked. All ctnetlink and nf_tables spots need to cleanup after themselves.