[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aUnBcNG1j5usNBtu@infradead.org>
Date: Mon, 22 Dec 2025 14:08:48 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Keith Busch <kbusch@...nel.org>
Cc: Christoph Hellwig <hch@...radead.org>, veygax <veyga@...gax.dev>,
Ming Lei <ming.lei@...hat.com>, Jens Axboe <axboe@...nel.dk>,
"io-uring@...r.kernel.org" <io-uring@...r.kernel.org>,
Caleb Sander Mateos <csander@...estorage.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] io_uring/rsrc: fix slab-out-of-bounds in
io_buffer_register_bvec
On Mon, Dec 22, 2025 at 07:29:31AM +0800, Keith Busch wrote:
> > The above is simply an open coded version of doing repeated
> > __bio_add_page calls. Which would be rather suboptimal, but perfectly
> > valid.
>
> Yeah, there's nothing stopping someone from using it that way, but a
> quick survey of __bio_add_page() users appear to be special cases that
> allocate a single vector bio, so its existing use is a short-cut that
> bio_add_page() will inevitiably reach anyway. Did you intend for it to
> be called directly for multiple vector uses too? It is suboptimal as you
> said, so it still feels like a misuse if someone did that.
We can't even force users to use __bio_add_page. Take a look at
drivers/md/bcache/util.c:bch_bio_map() for a real-life example for
something that could create this bvec pattern.
Powered by blists - more mailing lists