Re: possible deadlock in __do_page_fault

From: Tetsuo Handa
Date: Fri Jan 25 2019 - 11:02:10 EST


On 2019/01/24 22:46, Joel Fernandes wrote:
> On Thu, Jan 24, 2019 at 10:52:30AM +0900, Tetsuo Handa wrote:
>> Joel Fernandes wrote:
>>>> Anyway, I need your checks regarding whether this approach is waiting for
>>>> completion at all locations which need to wait for completion.
>>>
>>> I think you are waiting in unwanted locations. The only location you need to
>>> wait in is ashmem_pin_unpin.
>>>
>>> So, to my eyes all that is needed to fix this bug is:
>>>
>>> 1. Delete the range from the ashmem_lru_list
>>> 2. Release the ashmem_mutex
>>> 3. fallocate the range.
>>> 4. Do the completion so that any waiting pin/unpin can proceed.
>>>
>>> Could you clarify why you feel you need to wait for completion at those other
>>> locations?

OK. Here is an updated patch.
Passed syzbot's best-effort testing using reproducers on all three reports.