From af9dc367e3e3386271bc863c3d42ada1c518746c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Sun, 29 Aug 2010 01:05:02 -0400 Subject: [PATCH] http://list.linux-vserver.org/archive?mss:4196 --- delta-vx_rss_avail.patch | 24 ++++++++++++++++++++++++ kernel-2.6.spec | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 delta-vx_rss_avail.patch diff --git a/delta-vx_rss_avail.patch b/delta-vx_rss_avail.patch new file mode 100644 index 000000000..bb658a537 --- /dev/null +++ b/delta-vx_rss_avail.patch @@ -0,0 +1,24 @@ + + the check_stack_guard_page() has, under certain circumstances, side-effects which can not easily be undone in case the vx_rss_avail() fails + +diff --git a/mm/memory.c b/mm/memory.c +index c53939d..158c500 100644 +--- a/mm/memory.c ++++ b/mm/memory.c +@@ -2439,13 +2439,14 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma, + + pte_unmap(page_table); + ++ if (!vx_rss_avail(mm, 1)) ++ goto oom; ++ + /* Check if we need to add a guard page to the stack */ + if (check_stack_guard_page(vma, address) < 0) + return VM_FAULT_SIGBUS; + + /* Allocate our own private page. */ +- if (!vx_rss_avail(mm, 1)) +- goto oom; + if (unlikely(anon_vma_prepare(vma))) + goto oom; + page = alloc_zeroed_user_highpage_movable(vma, address); diff --git a/kernel-2.6.spec b/kernel-2.6.spec index ecd411f92..5b9bf08d3 100644 --- a/kernel-2.6.spec +++ b/kernel-2.6.spec @@ -159,6 +159,7 @@ Patch200: patch-%{rpmversion}-vs%{vsversion}.diff Patch220: delta-ptrace-fix01.diff Patch230: delta-pivot-fix01.diff Patch240: delta-killperm-fix01.diff +Patch241: delta-vx_rss_avail.patch # IP sets Patch250: linux-2.6-250-ipsets.patch @@ -365,6 +366,7 @@ KERNEL_PREVIOUS=vanilla %ApplyPatch 220 %ApplyPatch 230 %ApplyPatch 240 +%ApplyPatch 241 %ApplyPatch 250 -- 2.43.0