Re: [PATCH] io_uring: fix mm use with IORING_OP_{READ,WRITE}

From: Jens Axboe
Date: Wed Feb 05 2020 - 11:05:13 EST


On 2/5/20 9:02 AM, Pavel Begunkov wrote:
> On 05/02/2020 18:54, Jens Axboe wrote:
>> On 2/5/20 8:46 AM, Pavel Begunkov wrote:
>>> IORING_OP_{READ,WRITE} need mm to access user buffers, hence
>>> req->has_user check should go for them as well. Move the corresponding
>>> imports past the check.
>>
>> I'd need to double check, but I think the has_user check should just go.
>> The import checks for access anyway, so we'll -EFAULT there if we
>> somehow messed up and didn't acquire the right mm.
>>
> It'd be even better. I have plans to remove it, but I was thinking from a
> different angle.

Let me just confirm it in practice, but it should be fine. Then we can just
kill it.

--
Jens Axboe