--- linux-2.6.9/mm/memory.c_orig 2004-11-08 13:26:37.000000000 +0100 +++ linux-2.6.9/mm/memory.c 2004-11-08 13:30:26.000000000 +0100 @@ -766,6 +766,7 @@ do { struct page *map; int lookup_write = write; + unsigned int mm_fault_count = 0; while (!(map = follow_page(mm, start, lookup_write))) { /* * Shortcut for anonymous pages. We don't want @@ -794,6 +795,11 @@ default: BUG(); } + if (mm_fault_count > 0) { + printk("get_user_pages(): mm_fault_count exceeded.\n"); + return i ? i : -EFAULT; + } + mm_fault_count++; /* * Now that we have performed a write fault * and surely no longer have a shared page we