[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c47c032a-bf47-4c5b-b854-37c33a27cb39@redhat.com>
Date: Wed, 28 Feb 2024 11:46:56 +0100
From: David Hildenbrand <david@...hat.com>
To: Suren Baghdasaryan <surenb@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Qi Zheng <zhengqi.arch@...edance.com>, aarcange@...hat.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: userfaultfd: fix unexpected change to src_folio when
UFFDIO_MOVE fails
On 22.02.24 22:56, Suren Baghdasaryan wrote:
> On Thu, Feb 22, 2024 at 1:00 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>>
>> On Thu, 22 Feb 2024 16:08:15 +0800 Qi Zheng <zhengqi.arch@...edance.com> wrote:
>>
>>> After ptep_clear_flush(), if we find that src_folio is pinned we will fail
>>> UFFDIO_MOVE and put src_folio back to src_pte entry, but the change to
>>> src_folio->{mapping,index} is not restored in this process. This is not
>>> what we expected, so fix it.
>>>
>>> Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI")
>>
>> What are the expected worst-case userspace-visible runtime effects of
>> this flaw?
>
> It can cause rmap for that page to be invalid. I guess memory
> corruption might be the visible effect?
At least swapout+migration would no longer work, because we might fail
to locate the mappings of that folio.
Memory corruption, not sure.
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists