> copy_huge_pmd() reads a special PMD without the page table lock and
> copies that value to the child. The mmap write lock held by fork does
> not stop unmap_mapping_range(): it zaps under i_mmap_rwsem and the PMD
> lock.
>
> The zap visits the parent VMA before the child's, as dup_mmap() links
> the child right after the parent in i_mmap. If it clears the parent PMD
> after fork has read it, and passes the child before fork copies it, the
> child keeps a mapping the driver has revoked:
>
> - vfio-pci: the child reaches the BAR after the device memory was
> disabled or the device was reset, instead of getting SIGBUS;
> - panthor: the child maps the pages of an evicted buffer object after
> they are freed.
>
> [ ... ]
> Fixes: bc02afbd4d73 ("mm/fork: accept huge pfnmap entries")
> https://virtuozzo.atlassian.net/browse/VSTOR-150144
>
> Feature: fix ms/mm
> Signed-off-by: Konstantin Khorenko <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review ยท
https://sashiko.vzint.dev/#/patchset/20261104-b4-prep-khorenko-vstor-149847-1-upstream-fixes-v2-0-2974ec52f...@virtuozzo.com?part=1
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel