]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hugetlbfs: use truncate mutex to prevent pmd sharing race
authorMike Kravetz <mike.kravetz@oracle.com>
Thu, 8 Nov 2018 00:10:28 +0000 (16:10 -0800)
committerBrian Maly <brian.maly@oracle.com>
Mon, 24 Dec 2018 01:53:10 +0000 (20:53 -0500)
commitc4b649c0d657bb58343bddc7ae1474426b63fbdc
tree85bf451e2a53fa19d6b2575729ad268cc0938881
parentdbd6369a59eaf1ba714bed72e57ac4485552e07d
hugetlbfs: use truncate mutex to prevent pmd sharing race

The synchronization mechanism for hugetlbfs pagefaults/truncation and
pmd sharing ideally needs to be modified to use i_mmap_rwsem.  See:
http://lkml.kernel.org/r/20181024045053.1467-1-mike.kravetz@oracle.com

In UEK, we have introduced a hugetlbfs truncate mutex in an inode
extension.  By taking this mutex earlier in hugetlb_fault (before calling
huge_pte_alloc), we eliminate the most common cause of problems where
ptep can be altered by a call to huge_pmd_unshare.

Orabug: 28896255

Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Larry Bassel <larry.bassel@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
mm/hugetlb.c