/[linux-patches]/genpatches-2.6/tags/2.6.14-6/1044_4_ptrace-poke-hugepage.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.14-6/1044_4_ptrace-poke-hugepage.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 233 - (show annotations) (download)
Thu Dec 15 16:43:31 2005 UTC (12 years, 6 months ago) by dsd
File size: 1544 byte(s)
2.6.14-6 release
1 From stable-bounces@linux.kernel.org Tue Nov 29 19:46:57 2005
2 Date: Tue, 29 Nov 2005 19:46:37 -0800
3 From: akpm@osdl.org
4 To: stable@kernel.org
5 Cc: wli@holomorphy.com, david@gibson.dropbear.id.au
6 Subject: Fix crash when ptrace poking hugepage areas
7
8 From: David Gibson <david@gibson.dropbear.id.au>
9
10 set_page_dirty() will not cope with being handed a page * which is part of
11 a compound page, but not the master page in that compound page. This case
12 can occur via access_process_vm() if you attemp to write to another
13 process's hugepage memory area using ptrace() (causing an oops or hang).
14
15 This patch fixes the bug by only calling set_page_dirty() from
16 access_process_vm() if the page is not a compound page. We already use a
17 similar fix in bio_set_pages_dirty() for the case of direct io to
18 hugepages.
19
20 Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
21 Acked-by: William Irwin <wli@holomorphy.com>
22 Signed-off-by: Andrew Morton <akpm@osdl.org>
23 Signed-off-by: Chris Wright <chrisw@osdl.org>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
25 ---
26 kernel/ptrace.c | 3 ++-
27 1 file changed, 2 insertions(+), 1 deletion(-)
28
29 --- linux-2.6.14.3.orig/kernel/ptrace.c
30 +++ linux-2.6.14.3/kernel/ptrace.c
31 @@ -238,7 +238,8 @@ int access_process_vm(struct task_struct
32 if (write) {
33 copy_to_user_page(vma, page, addr,
34 maddr + offset, buf, bytes);
35 - set_page_dirty_lock(page);
36 + if (!PageCompound(page))
37 + set_page_dirty_lock(page);
38 } else {
39 copy_from_user_page(vma, page, addr,
40 buf, maddr + offset, bytes);

  ViewVC Help
Powered by ViewVC 1.1.20