Re: [PATCH] io_uring/kbuf: fix missing check for return value of io_buffer_get_list()

From: Jens Axboe
Date: Wed Jun 14 2023 - 12:15:07 EST


On 6/14/23 9:12?AM, Chenyuan Mi wrote:
> The io_buffer_get_list() function may return NULL, which may
> cause null pointer deference, and other callsites of
> io_buffer_get_list() all do Null check. Add Null check for
> return value of io_buffer_get_list().
>
> Found by our static analysis tool.

Ah, was going to ask about a test case, but I guess it doesn't exist.
I don't think this can happen, as the legacy buffer groups can only ever
get added, and only get removed when the ring goes away.

--
Jens Axboe