mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-14 08:13:56 +08:00
thp: avoid dumping huge zero page
No reason to preserve the huge zero page in core dumps. Reported-by: Michel Lespinasse <walken@google.com> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reviewed-by: Michel Lespinasse <walken@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a9bae18954
commit
85facf2570
@ -1257,6 +1257,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
|
|||||||
if (flags & FOLL_WRITE && !pmd_write(*pmd))
|
if (flags & FOLL_WRITE && !pmd_write(*pmd))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* Avoid dumping huge zero page */
|
||||||
|
if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd))
|
||||||
|
return ERR_PTR(-EFAULT);
|
||||||
|
|
||||||
page = pmd_page(*pmd);
|
page = pmd_page(*pmd);
|
||||||
VM_BUG_ON(!PageHead(page));
|
VM_BUG_ON(!PageHead(page));
|
||||||
if (flags & FOLL_TOUCH) {
|
if (flags & FOLL_TOUCH) {
|
||||||
|
Loading…
Reference in New Issue
Block a user