From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f169.google.com (mail-we0-f169.google.com [74.125.82.169]) by dpdk.org (Postfix) with ESMTP id BF76E11C5 for ; Tue, 24 Mar 2015 21:08:27 +0100 (CET) Received: by weop45 with SMTP id p45so3200371weo.0 for ; Tue, 24 Mar 2015 13:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TEWKIz8nMozC3LOcK8l9V8XOw2IQ1vzTF1s58kYe09k=; b=FbGgv6fMrn7aper2g45jCzLcYsaDWakSQpvbn7408Lif8Bd5BF4t1KzKKk2dbwfOki cwrESENztJW4mJ86TgxBicyunrdcVZaMBSI5z48njfwCVtj0ULeLLwCMC2ICM9b4KHqv Mjj+KzMSGAaeW/aFZNr/tlO9tDI9RnZ1CZZ18= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=TEWKIz8nMozC3LOcK8l9V8XOw2IQ1vzTF1s58kYe09k=; b=B0f3Ig5z7SehdX1QY2HrTDiTBVOJL+NQYdcJBi7trX6bLoVZzhnsjRbLq1ar0uwlG0 MmF5B7eIOpbxc6MsjtfQe8LjAjRMKn1/G4NoVlRae9Vdpwd6s0gK0OxZet+clBPMCDA9 e7EjHvl4/WM/bf9hlDuvSJaN4zFtrvrr5vJTc4TRS+FmYrdxsHOJAOSnf1ht0VJLPtII 68Twq5rRoH3yF4mAcCqqGBPDS4hu9vzNrgCxdBUOtJAt5qYMe0hP39OxiIU5JNDa902s s6yheWZ5e6wA/CD7VG8vaQuNdUW5v2bqp2d2L+lsCiNGvrG599yfVDIDtUNc9eAKiwWb RFbw== X-Gm-Message-State: ALoCoQkDRKq+7zq+Q72BO7XEI230m+hWr0Mc2/IZyhwzA5haSXoRMvot/NwRy/9YsNOVNJaS1gpC MIME-Version: 1.0 X-Received: by 10.180.89.148 with SMTP id bo20mr30959991wib.91.1427227706619; Tue, 24 Mar 2015 13:08:26 -0700 (PDT) Received: by 10.194.76.7 with HTTP; Tue, 24 Mar 2015 13:08:26 -0700 (PDT) In-Reply-To: References: <1427115225-14489-1-git-send-email-pboldin@mirantis.com> Date: Tue, 24 Mar 2015 22:08:26 +0200 Message-ID: From: Pavel Boldin To: "Xie, Huawei" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2015 20:08:28 -0000 On Tue, Mar 24, 2015 at 6:20 PM, Xie, Huawei wrote: > On 3/24/2015 7:10 PM, Pavel Boldin wrote: > > > On Tue, Mar 24, 2015 at 8:28 AM, Xie, Huawei huawei.xie@intel.com>> wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's reference counter subsequent call > > to `filp_close' does not free the `struct file'. Prepend `fput' call > > to decrease the reference counter. > > > > Signed-off-by: Pavel Boldin pboldin@mirantis.com>> > > --- > > lib/librte_vhost/eventfd_link/eventfd_link.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c > b/lib/librte_vhost/eventfd_link/eventfd_link.c > > index 7755dd6..62c45c8 100644 > > --- a/lib/librte_vhost/eventfd_link/eventfd_link.c > > +++ b/lib/librte_vhost/eventfd_link/eventfd_link.c > > @@ -117,6 +117,7 @@ eventfd_link_ioctl(struct file *f, unsigned int > ioctl, unsigned long arg) > > * Release the existing eventfd in the source process > > */ > > spin_lock(&files->file_lock); > > + fput(file); > > filp_close(file, files); > > fdt = files_fdtable(files); > > fdt->fd[eventfd_copy.source_fd] = NULL; > Acked-by Huawei Xie > > > In future, we should remove the allocation of src eventfd, allocate a > free fd from kernel, and install it with target fd. > > Well, I don't think this is correct, because this will put too much job > for the kernel module making it a combiner. > > At the moment I propose to accept module refactoring patch to the upstream. > > After that the module can be reworked along with the application code. The > reason is I can't work on DPDK since I have no hardware to test application > at so I can't help with patch that touches application code. > > Pavel > Pavel: > I am not asking to do it right now but in future, and i agree we accept > the refactoring patch now, so i ack the patch. > Huawei, this is the refactoring patch [1]. This patch is merely a bugfix. [1] http://dpdk.org/dev/patchwork/patch/4113/ > Huawei >