Re: [PATCH Next] iomap: Add sanity check for dio done workqueue

From: Christoph Hellwig
Date: Mon Nov 24 2025 - 04:21:46 EST


On Mon, Nov 24, 2025 at 04:53:04PM +0800, Edward Adam Davis wrote:
> The s_dio_done_wq was not allocated memory, leading to the null-ptr-deref
> reported by syzbot in [1].
>
> As shown in [1], we are currently in a soft interrupt context, and we cannot
> use sb_init_dio_done_wq() to allocate memory for wq because it requires a
> mutex lock.
>
> Added a check to the workqueue; if it is empty, it switches to using a
> synchronous method to end the dio.

Err no. That sanity check doesn't do anything useful. Whatever caused
it to be not allocated and allow I/O needs to be fixed. And I suspect
it's my fault and I already have an idea how to fix, so don't rush it.