From: Chris Wright Date: Wed, 30 Nov 2005 05:27:42 +0000 (-0800) Subject: Add hugepages fix, fwd from akpm. X-Git-Tag: v2.6.14.4~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78fe81239d465aa50b3956de00ac0665ca38c4c5;p=thirdparty%2Fkernel%2Fstable-queue.git Add hugepages fix, fwd from akpm. --- diff --git a/queue/fix-crash-when-ptrace-poking-hugepage-areas.patch b/queue/fix-crash-when-ptrace-poking-hugepage-areas.patch new file mode 100644 index 00000000000..7ba5b6eb84f --- /dev/null +++ b/queue/fix-crash-when-ptrace-poking-hugepage-areas.patch @@ -0,0 +1,42 @@ +From stable-bounces@linux.kernel.org Tue Nov 29 19:46:57 2005 +Date: Tue, 29 Nov 2005 19:46:37 -0800 +From: akpm@osdl.org +To: stable@kernel.org +Cc: wli@holomorphy.com, david@gibson.dropbear.id.au +Subject: Fix crash when ptrace poking hugepage areas + +From: David Gibson + +set_page_dirty() will not cope with being handed a page * which is part of +a compound page, but not the master page in that compound page. This case +can occur via access_process_vm() if you attemp to write to another +process's hugepage memory area using ptrace() (causing an oops or hang). + +This patch fixes the bug by only calling set_page_dirty() from +access_process_vm() if the page is not a compound page. We already use a +similar fix in bio_set_pages_dirty() for the case of direct io to +hugepages. + +Signed-off-by: David Gibson +Acked-by: William Irwin +Signed-off-by: Andrew Morton +Signed-off-by: Chris Wright +--- + + kernel/ptrace.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletion(-) + +Index: linux-2.6.14.y/kernel/ptrace.c +=================================================================== +--- linux-2.6.14.y.orig/kernel/ptrace.c ++++ linux-2.6.14.y/kernel/ptrace.c +@@ -238,7 +238,8 @@ int access_process_vm(struct task_struct + if (write) { + copy_to_user_page(vma, page, addr, + maddr + offset, buf, bytes); +- set_page_dirty_lock(page); ++ if (!PageCompound(page)) ++ set_page_dirty_lock(page); + } else { + copy_from_user_page(vma, page, addr, + buf, maddr + offset, bytes); diff --git a/queue/series b/queue/series index 9b879d818c8..662591201cd 100644 --- a/queue/series +++ b/queue/series @@ -1,3 +1,4 @@ dpt_i2o-fix-a-null-pointer-deref.patch message-i2o-pci-fix-null-pointer-deref.patch infiniband-fix-a-null-pointer-deref.patch +fix-crash-when-ptrace-poking-hugepage-areas.patch