From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guillaume Nault Subject: Re: [PATCH net] l2tp: fix a sock refcnt leak in l2tp_tunnel_register Date: Tue, 13 Nov 2018 15:51:17 +0100 Message-ID: <20181113145117.GF1415@alphalink.fr> References: <7e6ee3c12afb3c98bd1b49e5825803ab1efed4c1.1542042505.git.lucien.xin@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: network dev , davem@davemloft.net To: Xin Long Return-path: Received: from zimbra.alphalink.fr ([217.15.80.77]:34486 "EHLO zimbra.alphalink.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732664AbeKNAtt (ORCPT ); Tue, 13 Nov 2018 19:49:49 -0500 Content-Disposition: inline In-Reply-To: <7e6ee3c12afb3c98bd1b49e5825803ab1efed4c1.1542042505.git.lucien.xin@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Nov 13, 2018 at 01:08:25AM +0800, Xin Long wrote: > This issue happens when trying to add an existent tunnel. It > doesn't call sock_put() before returning -EEXIST to release > the sock refcnt that was held by calling sock_hold() before > the existence check. > > This patch is to fix it by holding the sock after doing the > existence check. > Nice fix. Thanks Xin! Reviewed-by: Guillaume Nault