From: Noah Goldstein <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Pavel Begunkov <[email protected]>,
"open list:IO_URING" <[email protected]>,
open list <[email protected]>
Subject: Re: [PATCH v1] io_uring: Fix memory leak if file setup fails.
Date: Fri, 29 Apr 2022 10:36:57 -0500 [thread overview]
Message-ID: <CAFUsyfK-Mo76PNBHmvUnavHgemgb92g2muqWJjPKv5T7TE-rhA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
On Fri, Apr 29, 2022 at 7:47 AM Jens Axboe <[email protected]> wrote:
>
> On 4/28/22 6:42 PM, Noah Goldstein wrote:
> > If `get_unused_fd_flags` files fails (either in setting up `ctx` as
> > `tctx->last` or `get_unused_fd_flags`) `ctx` will never be freed.
>
> There's a comment there telling you why, the fput will end up
> releasing it just like it would when an application closes it.
I see. Thought the 'it' refered to in the comment was the file, not
ctx.
>
> > I very well may be missing something (or there may be a double
> > free if the failure is after `get_unused_fd_flags`) but looks
> > to me to be a memory leak.
>
> Have you tried synthetically reproducing the two failures you're
> thinking of and tracing cleanup?
>
> --
> Jens Axboe
>
prev parent reply other threads:[~2022-04-29 15:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 0:42 [PATCH v1] io_uring: Fix memory leak if file setup fails Noah Goldstein
2022-04-29 12:47 ` Jens Axboe
2022-04-29 15:36 ` Noah Goldstein [this message]
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=CAFUsyfK-Mo76PNBHmvUnavHgemgb92g2muqWJjPKv5T7TE-rhA@mail.gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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