Linux io-uring development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Aayush7352 <aayushdixit924@gmail.com>, io-uring@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] io_uring/kbuf: fix UAF in buffer selection when access_ok fails on expanded iovec
Date: Tue, 21 Jul 2026 08:54:18 -0600	[thread overview]
Message-ID: <0f1fa2f1-34d9-4ee1-8938-50703f684ae3@kernel.dk> (raw)
In-Reply-To: <20260721095711.80711-1-aayushdixit924@gmail.com>

On 7/21/26 3:57 AM, Aayush7352 wrote:
> From: Aayush Dixit <aayushdixit924@gmail.com>
> 
> In io_ring_buffers_peek(), when the buffer ring is expanded
> (KBUF_MODE_EXPAND), arg->iovs is set to a newly kmalloced array.
> If access_ok() then fails on a buffer entry, the error path kfrees
> the new array but does not restore arg->iovs to the original value
> (org_iovs).  arg->iovs is left dangling and will be reused on retry,
> causing a use-after-free when the caller retries the buffer selection.
> 
> Fix by restoring arg->iovs = org_iovs after the kfree on the error
> path, so the caller's state remains coherent on retry.

You sent this twice, replying once for both: this is bogus. If your
LLM thinks it found something, have it write a reproducer. Then YOU
reproduce, and then you can report it. Don't waste our time with
garbage like this.

> Fixes: b3e0216c97e3 ("io_uring: add buffer ring support")

This is also bogus, this sha doesn't exist.

-- 
Jens Axboe


  reply	other threads:[~2026-07-21 14:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  9:57 [PATCH] io_uring/kbuf: fix UAF in buffer selection when access_ok fails on expanded iovec Aayush7352
2026-07-21 14:54 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-21  8:47 Aayush7352

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=0f1fa2f1-34d9-4ee1-8938-50703f684ae3@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=aayushdixit924@gmail.com \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox