[PATCH] for Bug kdb 4.3 user context not working correctly.

Prasanna S Panchamukhi prasanna at in.ibm.com
Fri Nov 14 06:51:03 PST 2003


Hi,

While accessing the userspace page, the address was aligned to the next page
boundry. This was giving the kdb_getarea: Bad area message while dumping the memory.

The fix below for linux-2.4.23-rc1 takes care of aligning the address to the current page boundry and
now the dumping memory within this page should not be a problem.

diff -urNp linux.orig/kdb/kdbsupport.c linux-rc1+kdb/kdb/kdbsupport.c
--- linux.orig/kdb/kdbsupport.c	2003-11-15 12:41:05.000000000 +0530
+++ linux-rc1+kdb/kdb/kdbsupport.c	2003-11-15 12:25:00.000000000 +0530
@@ -815,7 +815,10 @@ static struct page * kdb_get_one_user_pa
 		return NULL;
 	}
 
-	start = PAGE_ALIGN(start);
+	/* we need to align start address to the current page boundy, PAGE_ALIGN
+	 * aligns to next page boundry. 
+	 */
+	start = start & PAGE_MASK;
 	flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);
 
 	vma = find_extend_vma(mm, start);
-- 
Thanks & Regards
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Ph: 91-80-5044632



More information about the kdb mailing list