From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 85BAC5A1F for ; Thu, 26 Mar 2015 08:56:26 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 26 Mar 2015 00:56:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,470,1422950400"; d="scan'208";a="546554744" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga003.jf.intel.com with ESMTP; 26 Mar 2015 00:56:16 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 26 Mar 2015 15:56:10 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.36]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.10]) with mapi id 14.03.0224.002; Thu, 26 Mar 2015 15:56:09 +0800 From: "Xie, Huawei" To: Pavel Boldin , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link' Thread-Index: AdBnmlGqPVYoudlue02yvo5DCI00vw== Date: Thu, 26 Mar 2015 07:56:09 +0000 Message-ID: References: <1427115225-14489-1-git-send-email-pboldin@mirantis.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Thu, 26 Mar 2015 07:56:27 -0000 On 3/23/2015 8:54 PM, Pavel Boldin wrote:=0A= > Due to increased `struct file's reference counter subsequent call=0A= > to `filp_close' does not free the `struct file'. Prepend `fput' call=0A= > to decrease the reference counter.=0A= >=0A= > Signed-off-by: Pavel Boldin =0A= > ---=0A= > lib/librte_vhost/eventfd_link/eventfd_link.c | 1 +=0A= > 1 file changed, 1 insertion(+)=0A= >=0A= > diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vh= ost/eventfd_link/eventfd_link.c=0A= > index 7755dd6..62c45c8 100644=0A= > --- a/lib/librte_vhost/eventfd_link/eventfd_link.c=0A= > +++ b/lib/librte_vhost/eventfd_link/eventfd_link.c=0A= > @@ -117,6 +117,7 @@ eventfd_link_ioctl(struct file *f, unsigned int ioctl= , unsigned long arg)=0A= > * Release the existing eventfd in the source process=0A= > */=0A= > spin_lock(&files->file_lock);=0A= > + fput(file);=0A= > filp_close(file, files);=0A= > fdt =3D files_fdtable(files);=0A= > fdt->fd[eventfd_copy.source_fd] =3D NULL;=0A= =0A= Acked-by Huawei Xie =0A= =0A= =0A=