Re: possible deadlock in __do_page_fault

From: Tetsuo Handa
Date: Tue Jan 22 2019 - 05:32:40 EST


On 2019/01/22 19:12, Dmitry Vyukov wrote:
> On Tue, Jan 22, 2019 at 11:02 AM Tetsuo Handa
> <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote:
>>
>> On 2018/09/22 8:21, Andrew Morton wrote:
>>> On Thu, 20 Sep 2018 19:33:15 -0400 Joel Fernandes <joel@xxxxxxxxxxxxxxxxx> wrote:
>>>
>>>> On Thu, Sep 20, 2018 at 5:12 PM Todd Kjos <tkjos@xxxxxxxxxx> wrote:
>>>>>
>>>>> +Joel Fernandes
>>>>>
>>>>> On Thu, Sep 20, 2018 at 2:11 PM Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>>>>>>
>>>>>>
>>>>>> Thanks. Let's cc the ashmem folks.
>>>>>>
>>>>
>>>> This should be fixed by https://patchwork.kernel.org/patch/10572477/
>>>>
>>>> It has Neil Brown's Reviewed-by but looks like didn't yet appear in
>>>> anyone's tree, could Greg take this patch?
>>>
>>> All is well. That went into mainline yesterday, with a cc:stable.
>>>
>>
>> This problem was not fixed at all.
>
> There are at least 2 other open deadlocks involving ashmem:

Yes, they involve ashmem_shrink_scan() => {shmem|vfs}_fallocate() sequence.
This approach tries to eliminate this sequence.

>
> https://syzkaller.appspot.com/bug?extid=148c2885d71194f18d28
> https://syzkaller.appspot.com/bug?extid=4b8b031b89e6b96c4b2e
>
> Does this fix any of these too?

I need checks from ashmem folks whether this approach is possible/correct.
But you can ask syzbot to test this patch before ashmem folks respond.