Re: [PATCH] mm/userfaultfd: selftests: Fix memory corruption with thp enabled

From: Andrew Morton
Date: Thu Sep 23 2021 - 22:19:58 EST


On Thu, 23 Sep 2021 19:25:12 -0400 Peter Xu <peterx@xxxxxxxxxx> wrote:

> In RHEL's gating selftests we've encountered memory corruption in the uffd
> event test even with upstream kernel:
>
> ...
>
>
> We can mark the Fixes tag upon 0db282ba2c12 as it's reported to only happen
> there, however the real "Fixes" IMHO should be 8ba6e8640844, as before that
> commit we'll always do explicit release_pages() before registration of uffd,
> and 8ba6e8640844 changed that logic by adding extra unmap/map and we didn't
> release the pages at the right place. Meanwhile I don't have a solid glue
> anyway on whether posix_memalign() could always avoid triggering this bug,
> hence it's safer to attach this fix to commit 8ba6e8640844.
>

Thanks. I added a cc:stable to this. I don't think we want selftests
in older kernels to be falsely reporting kernel bugs?