From: Benjamin LaHaise <ben@communityfibre.ca>
To: Cheng Yongkang <teel4res@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [BUG] fs/aio: io_setup integer wrap can exhaust global aio quota
Date: Thu, 22 Oct 2026 11:48:52 -0400 [thread overview]
Message-ID: <20261022154852.GQ8374@kvack.org> (raw)
In-Reply-To: <179268384018.50580.15623131516982541149@gmail.com>
aio_nr is never updated. Your analysis is entirely incorrect.
-ben
On Thu, Oct 22, 2026 at 08:44:06AM -0700, Cheng Yongkang wrote:
> Hi Ben,
>
> Thanks for the reply. I agree with the security triage: reaching this path
> requires root to raise fs.aio-max-nr to an unreasonable value, and I am not
> claiming a memory-safety issue, privilege-boundary bypass, or UAF. The impact
> is limited to global AIO quota accounting under that configuration.
>
> I do think there is a factual mismatch regarding the execution path described
> in your reply. The validation raises fs.aio-max-nr to 2147483649 before
> dropping privileges and calling io_setup(0x80000001). In that configuration:
>
> 1. max_reqs retains 0x80000001.
> 2. nr_events *= 2 wraps the request to 2.
> 3. The wrapped value passes the ring-size check.
> 4. aio_setup_ring() creates a one-page, 127-slot ring.
> 5. aio_nr += ctx->max_reqs charges the original 0x80000001.
> 6. ioctx_add_table() is called and succeeds.
> 7. A subsequent normal io_setup(1) fails with -EAGAIN.
>
> So, in this tested path, the ioctx is not destroyed before ioctx_alloc()
> returns, and ioctx_add_table() is reached. The ring is small while the global
> quota charge is large.
>
> I agree that this is a low-value, configuration-dependent correctness issue,
> not a security fix. My point is only that treating the configuration as
> unsupported is different from saying the wrapped path is cleaned up before it
> can be installed.
>
> I will be more conservative about AI-assisted findings going forward and will
> set a higher bar for preconditions, security impact, and whether a patch is
> worth maintainer time. If you consider this configuration unsupported, I will
> withdraw the patch.
>
> Thanks,
> Cheng
>
--
"Thought is the essence of where you are now."
next prev parent reply other threads:[~2026-10-22 15:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 9:17 [BUG] fs/aio: io_setup integer wrap can exhaust global aio quota Cheng Yongkang
2026-10-22 15:23 ` Benjamin LaHaise
2026-10-22 15:44 ` Cheng Yongkang
2026-10-22 15:48 ` Benjamin LaHaise [this message]
2026-10-22 16:01 ` Cheng Yongkang
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=20261022154852.GQ8374@kvack.org \
--to=ben@communityfibre.ca \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=teel4res@gmail.com \
--cc=viro@zeniv.linux.org.uk \
/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.