From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Pavel Boldin <pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH v2] Fix `eventfd_link' module leakages and races
Date: Mon, 23 Mar 2015 12:44:03 +0100 [thread overview]
Message-ID: <2367297.OP1GXNRJq9@xps13> (raw)
In-Reply-To: <CACf4_B8buRSAPCFO+fWJjQ8it5n0cgN789jSrsB6Bc-cJGOyHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 13:36, Pavel Boldin:
> Hi Thomas,
>
> There is by far more than 2 issues, but these are the only ones that
> appeared to us.
>
> The list of the issues that motivated the refactoring:
>
> 1. Only one error code for every fault (-EFAULT).
> 2. Copy-paste code from the `fget' function.
> 3. Ambiguous variable names. The `files' variable mean different things
> under the same block. This ruins readability of the code.
> 4. Overall placing of the all the code inside one `switch/case'. Modern
> kernel code style suggests placing these in the inline functions.
> 5. Usage of the copy-pasted `close_fd' function code. (I really should
> use `sys_close' here though).
>
>
> I can rewrite the refactoring in a set of small patches if this will aid
> reviewers.
>
> The dangerous bug that definitely must be fixed before the next release is
> the `struct file*' leakage. I can provide a simple patch for this as a
> separate submission and continue working on the refactoring patches. Is
> this plan OK for you?
Yes, please separate important fixes and refactoring.
Then we'll be able to merge the fixes in 2.0.
PS: please answer below the question to ease thread reading.
Thanks
> On Mon, Mar 23, 2015 at 1:15 PM, Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
> wrote:
>
> > Hi Pavel,
> >
> > You forgot the Signed-off-by line.
> >
> > Huawei, Changchun, any comment on this patch?
> >
> > 2015-03-18 15:16, Pavel Boldin:
> > > The `eventfd_link' module provides an API to "steal" fd from another
> > > process had been written with a bug that leaks `struct file' because
> > > of the extra reference counter increment and missing `fput' call.
> > >
> > > The other bug is using another process' `task_struct' without
> > incrementing
> > > a reference counter.
> >
> > As there are 2 bugs, you should provide 2 patches.
> >
> > > Fix these bugs and refactor the module.
> >
> > Why refactoring along with the bug fixes?
> > You'd have more chances to have your fixes integrated in 2.0 without
> > refactoring.
> >
> > Thanks
next prev parent reply other threads:[~2015-03-23 11:44 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 16:40 [PATCH] Fix `eventfd_link' module leakages and races Pavel Boldin
[not found] ` <1426524059-30886-1-git-send-email-pboldin+dpdk-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
2015-03-16 17:55 ` Neil Horman
2015-03-17 1:29 ` Ouyang, Changchun
[not found] ` <F52918179C57134FAEC9EA62FA2F962511A5E173-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-20 15:57 ` Pavel Boldin
2015-03-18 13:16 ` [PATCH v2] " Pavel Boldin
[not found] ` <1426684571-14782-1-git-send-email-pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
2015-03-23 11:15 ` Thomas Monjalon
2015-03-23 11:36 ` Pavel Boldin
[not found] ` <CACf4_B8buRSAPCFO+fWJjQ8it5n0cgN789jSrsB6Bc-cJGOyHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-23 11:44 ` Thomas Monjalon [this message]
2015-03-23 15:15 ` [PATCH v3] vhost: Refactor module `eventfd_link' Pavel Boldin
[not found] ` <1427123731-15654-1-git-send-email-pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
2015-04-02 17:01 ` [PATCH v4 0/5] " Pavel Boldin
[not found] ` <1427994080-10163-1-git-send-email-pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
2015-04-02 17:01 ` [PATCH v4 1/5] vhost: eventfd_link: moving ioctl to a function Pavel Boldin
2015-05-07 7:57 ` Xie, Huawei
[not found] ` <C37D651A908B024F974696C65296B57B0F476887-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-05-07 13:16 ` Pavel Boldin
2015-05-18 6:06 ` Xie, Huawei
2015-05-18 9:16 ` Pavel Boldin
2015-06-18 3:08 ` Xie, Huawei
2015-04-02 17:01 ` [PATCH v4 2/5] vhost: eventfd_link: add function fget_from_files Pavel Boldin
2015-04-02 17:01 ` [PATCH v4 3/5] vhost: eventfd_link: fix ioctl return values Pavel Boldin
2015-04-02 17:01 ` [PATCH v4 4/5] vhost: eventfd_link: replace copy-pasted sys_close Pavel Boldin
2015-04-02 17:01 ` [PATCH v4 5/5] vhost: eventfd_link: removing extra #includes Pavel Boldin
2015-04-16 11:48 ` [PATCH v5 0/5] Refactor module `eventfd_link' Pavel Boldin
[not found] ` <1429184910-30186-1-git-send-email-pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org>
2015-04-16 11:48 ` [PATCH v5 1/5] vhost: eventfd_link: moving ioctl to a function Pavel Boldin
2015-08-28 18:51 ` [PATCH v5 1/4] vhost: eventfd_link: refactoring EVENTFD_COPY handler Pavel Boldin
2015-09-23 20:25 ` Pavel Boldin
2015-09-29 19:42 ` Thomas Monjalon
2015-09-29 23:29 ` Pavel Boldin
2015-10-20 9:06 ` Xie, Huawei
2015-10-28 18:33 ` [PATCH v6 0/3] vhost: eventfd_link refactoring Pavel Boldin
2015-10-29 18:33 ` Xie, Huawei
2015-10-30 19:10 ` Thomas Monjalon
2015-10-28 18:33 ` [PATCH v6 1/3] vhost: eventfd_link: refactoring EVENTFD_COPY handler Pavel Boldin
2015-10-28 18:33 ` [PATCH v6 2/3] vhost: add EVENTFD_COPY2 ioctl Pavel Boldin
2015-10-28 18:33 ` [PATCH v6 3/3] vhost: using EVENTFD_COPY2 Pavel Boldin
2015-08-28 18:51 ` [PATCH v5 2/4] vhost: add EVENTFD_COPY2 ioctl Pavel Boldin
2015-10-20 9:43 ` Xie, Huawei
2015-08-28 18:51 ` [PATCH v5 3/4] vhost: using EVENTFD_COPY2 Pavel Boldin
2015-10-20 9:52 ` Xie, Huawei
2015-10-21 12:16 ` Pavel Boldin
2015-10-26 1:45 ` Xie, Huawei
2015-10-28 18:35 ` Pavel Boldin
2015-08-28 18:51 ` [PATCH v5 4/4] DO NOT MERGE: Tests for new eventfd_link module Pavel Boldin
2015-04-16 11:48 ` [PATCH v5 2/5] vhost: eventfd_link: add function fget_from_files Pavel Boldin
2015-04-16 11:48 ` [PATCH v5 3/5] vhost: eventfd_link: fix ioctl return values Pavel Boldin
2015-04-16 11:48 ` [PATCH v5 4/5] vhost: eventfd_link: replace copy-pasted sys_close Pavel Boldin
2015-05-07 6:54 ` Xie, Huawei
2015-06-17 15:24 ` Thomas Monjalon
2015-07-09 0:59 ` Thomas Monjalon
2015-07-10 14:27 ` Xie, Huawei
2015-07-10 14:50 ` Pavel Boldin
2015-07-10 15:32 ` Xie, Huawei
2015-07-10 15:42 ` Xie, Huawei
2015-07-10 15:49 ` Thomas Monjalon
2015-07-10 16:06 ` Xie, Huawei
2015-07-11 15:08 ` Pavel Boldin
2015-07-13 1:59 ` Xie, Huawei
2015-07-19 12:39 ` Pavel Boldin
2015-04-16 11:48 ` [PATCH v5 5/5] vhost: eventfd_link: removing extra #includes Pavel Boldin
2015-04-28 14:35 ` [PATCH v5 0/5] Refactor module `eventfd_link' Thomas Monjalon
2015-05-04 5:29 ` 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=2367297.OP1GXNRJq9@xps13 \
--to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
--cc=pboldin-nYU0QVwCCFFWk0Htik3J/w@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.