Bug 1959192

Summary: Fix memfd_test failure on hugetlbfs (F_SEAL_FUTURE_WRITE fix; copy-on-write data corrupt)
Product: Red Hat Enterprise Linux 9 Reporter: Peter Xu <peterx>
Component: kernelAssignee: Peter Xu <peterx>
kernel sub component: Memory Management QA Contact: Li Wang <liwan>
Status: CLOSED NEXTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: aarcange, ddutile, dhildenb, lcapitulino, mm-maint, peterx, xiawu
Version: 9.0   
Target Milestone: beta   
Target Release: 9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-17 21:01:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Xu 2021-05-10 21:35:45 UTC
memfd_test fails for rhel9:

# uname -r
5.12.0-1.el9.x86_64
# ./memfd_test hugetlbfs
memfd-hugetlb: CREATE
memfd-hugetlb: BASIC
memfd-hugetlb: SEAL-WRITE
memfd-hugetlb: SEAL-FUTURE-WRITE
mmap() didn't fail as expected
Aborted (core dumped)

We need to make sure we'll get below fixes into rhel9 by either rebase or backport:

https://lore.kernel.org/lkml/20210503234356.9097-1-peterx@redhat.com/

The 1st patch is less important as it fixes F_SEAL_FUTURE_WRITE which may not have a huge lot of users, however good to have.  The 2nd fix is more important as it could cause data corruption.