Thread (10 messages) flat view 10 messages, 3 authors, 2021-05-03

Re: [PATCH 2/2] mm/hugetlb: Fix cow where page writtable in child

From: Mike Kravetz <hidden>
Date: 2021-05-03 20:53:58
Also in: lkml

On 5/1/21 7:41 AM, Peter Xu wrote:
When fork() and copy hugetlb page range, we'll remember to wrprotect src pte if
needed, however we forget about the child!  Without it, the child will be able
to write to parent's pages when mapped as PROT_READ|PROT_WRITE and MAP_PRIVATE,
which will cause data corruption in the parent process.

This issue can also be exposed by "memfd_test hugetlbfs" kselftest (if it can
pass the F_SEAL_FUTURE_WRITE test first, though).

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 mm/hugetlb.c | 2 ++
 1 file changed, 2 insertions(+)
Reviewed-by: Mike Kravetz <redacted>

I think we need to add, "Fixes: 4eae4efa2c29" as this is now in v5.12
-- 
Mike Kravetz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help