From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: Re: [Patch net v3] tun: fix a memory leak for tfile->tx_array Date: Tue, 16 Jan 2018 14:00:52 +0800 Message-ID: <16b82836-7e07-c13c-cd7b-917eaa06d224@redhat.com> References: <20180115193729.13220-1-xiyou.wangcong@gmail.com> <3c47b1dd-f8ae-87a7-a498-467b9027dcbc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Linux Kernel Network Developers , Dmitry Vyukov To: Cong Wang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:59570 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750822AbeAPGA4 (ORCPT ); Tue, 16 Jan 2018 01:00:56 -0500 In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 2018年01月16日 13:49, Cong Wang wrote: > On Mon, Jan 15, 2018 at 9:46 PM, Jason Wang wrote: >> >> I think then you don't even need the memset trick since we are sure it has >> been implemented? > It doesn't look like sk_alloc() zero's the memory of tfile. Typo, for "implemented" I mean "initialized". I mean we can leave __tun_detach() as is, and just add the cleanup to tun_detach_all(). This is because in both cases, we're sure skb array has been initialized before. Thanks