diff --git a/mm/page_alloc.c b/mm/page_alloc.c index caea788628e4dd62060e4838d385e9858f415f25..c313afcc8e5aeb52e7b142cfcd7e00d3b595a563 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2308,6 +2308,10 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, if ((gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY)) { if (oom_killer_disabled) goto nopage; + /* Coredumps can quickly deplete all memory reserves */ + if ((current->flags & PF_DUMPCORE) && + !(gfp_mask & __GFP_NOFAIL)) + goto nopage; page = __alloc_pages_may_oom(gfp_mask, order, zonelist, high_zoneidx, nodemask, preferred_zone,