Skip to content

Commit 85facf2

Browse files
kiryltorvalds
authored andcommitted
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>
1 parent a9bae18 commit 85facf2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎mm/huge_memory.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,10 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
12571257
if (flags & FOLL_WRITE && !pmd_write(*pmd))
12581258
goto out;
12591259

1260+
/* Avoid dumping huge zero page */
1261+
if ((flags & FOLL_DUMP) && is_huge_zero_pmd(*pmd))
1262+
return ERR_PTR(-EFAULT);
1263+
12601264
page = pmd_page(*pmd);
12611265
VM_BUG_ON(!PageHead(page));
12621266
if (flags & FOLL_TOUCH) {

0 commit comments

Comments
 (0)