Currently, scrubbing is done once before killing all recvzc requests. It's fine as those are cancelled and don't return buffers afterwards, but it'll be more reliable not to rely that much on cancellations. Signed-off-by: Pavel Begunkov --- io_uring/zcrx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 7b93c87b8371..60cef10dc491 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -986,6 +986,12 @@ void io_unregister_zcrx(struct io_ring_ctx *ctx) } if (!ifq) break; + /* + * io_uring can run requests and return buffers to the user + * after termination, scrub it again. + */ + if (refcount_read(&ifq->user_refs) == 0) + io_zcrx_scrub(ifq); io_put_zcrx_ifq(ifq); } -- 2.54.0