Re: IORING_REGISTER_CREDS[_UPDATE]() and credfd_create()?

Jens Axboe
2020-01-29T00:54:21Z

On 1/28/20 5:24 PM, Jens Axboe wrote:
> On 1/28/20 5:21 PM, Pavel Begunkov wrote:
>> On 29/01/2020 03:20, Jens Axboe wrote:
>>> On 1/28/20 5:10 PM, Pavel Begunkov wrote:
>>>>>>> Checked out ("don't use static creds/mm assignments")
>>>>>>>
>>>>>>> 1. do we miscount cred refs? We grab one in get_current_cred() for each async
>>>>>>> request, but if (worker->creds != work->creds) it will never be put.
>>>>>>
>>>>>> Yeah I think you're right, that needs a bit of fixing up.
>>>>>
>>>>
>>>> Hmm, it seems it leaks it unconditionally, as it grabs in a ref in
>>>> override_creds().
>>>>
>>>
>>> We grab one there, and an extra one. Then we drop one of them inline,
>>> and the other in __io_req_aux_free().
>>>
>> Yeah, with the last patch it should make it even
>
> OK good we agree on that. I should probably pull back that bit to the
> original patch to avoid having a hole in there...

Done

--
Jens Axboe