DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavel Boldin <pboldin@mirantis.com>
To: "Xie, Huawei" <huawei.xie@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'
Date: Tue, 24 Mar 2015 13:10:47 +0200	[thread overview]
Message-ID: <CACf4_B-x4yOwoksvOoDxipgahayNWdtQi-caNGtCL7ZxAMh-qg@mail.gmail.com> (raw)
In-Reply-To: <C37D651A908B024F974696C65296B57B0F3F46FB@SHSMSX101.ccr.corp.intel.com>

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 <huawei.xie@intel.com>
>
> 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

  reply	other threads:[~2015-03-24 11:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23 12:53 Pavel Boldin
2015-03-23 14:21 ` Xie, Huawei
2015-03-23 14:36   ` Pavel Boldin
2015-03-23 14:41     ` Xie, Huawei
2015-03-23 14:51       ` Pavel Boldin
2015-03-23 15:16         ` Xie, Huawei
2015-03-23 15:22           ` Thomas Monjalon
2015-03-23 15:27           ` Pavel Boldin
2015-03-23 15:36             ` Xie, Huawei
2015-03-23 15:44               ` Pavel Boldin
2015-03-24  6:28 ` Xie, Huawei
2015-03-24 11:10   ` Pavel Boldin [this message]
2015-03-24 16:20     ` Xie, Huawei
2015-03-24 20:08       ` Pavel Boldin
2015-03-26  7:53         ` Xie, Huawei
2015-03-27 11:12   ` Thomas Monjalon
2015-03-26  7:56 ` Xie, Huawei
2015-03-26 15:17   ` Pavel Boldin
2015-03-27 11:10   ` Thomas Monjalon
2015-03-27 12:36     ` Pavel Boldin
2015-03-27 13:15       ` Thomas Monjalon
2015-03-26 15:20 ` Xie, Huawei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACf4_B-x4yOwoksvOoDxipgahayNWdtQi-caNGtCL7ZxAMh-qg@mail.gmail.com \
    --to=pboldin@mirantis.com \
    --cc=dev@dpdk.org \
    --cc=huawei.xie@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).