All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Gabriel Krisman Bertazi <krisman@suse.de>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH] io_uring: Fix release of pinned pages when __io_uaddr_map fails
Date: Wed, 13 Mar 2024 15:45:36 -0600	[thread overview]
Message-ID: <27a9a6ef-c28a-4252-8b43-2b5a056da376@kernel.dk> (raw)
In-Reply-To: <20240313213912.1920-1-krisman@suse.de>

On 3/13/24 3:39 PM, Gabriel Krisman Bertazi wrote:
> Looking at the error path of __io_uaddr_map, if we fail after pinning
> the pages for any reasons, ret will be set to -EINVAL and the error
> handler won't properly release the pinned pages.
> 
> I didn't manage to trigger it without forcing a failure, but it can
> happen in real life when memory is heavily fragmented.

Good catch, fix looks good to me. I'll add a:

Fixes: 223ef4743164 ("io_uring: don't allow IORING_SETUP_NO_MMAP rings on highmem pages")

to it, however.

-- 
Jens Axboe



  reply	other threads:[~2024-03-13 21:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 21:39 [PATCH] io_uring: Fix release of pinned pages when __io_uaddr_map fails Gabriel Krisman Bertazi
2024-03-13 21:45 ` Jens Axboe [this message]
2024-03-13 21:56 ` Jens Axboe

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=27a9a6ef-c28a-4252-8b43-2b5a056da376@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    /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.