
From: Mark Frazer <mark@mjfrazer.org>

Just browsing users of get_user_pages today and noticed what might be a
bug.



 25-akpm/arch/i386/lib/usercopy.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN arch/i386/lib/usercopy.c~get_user_pages-lockup-fix arch/i386/lib/usercopy.c
--- 25/arch/i386/lib/usercopy.c~get_user_pages-lockup-fix	Thu Dec 18 11:19:23 2003
+++ 25-akpm/arch/i386/lib/usercopy.c	Thu Dec 18 11:19:23 2003
@@ -541,8 +541,10 @@ survive:
 				goto survive;
 			}
 
-			if (retval != 1)
+			if (retval != 1) {
+				up_read(&current->mm->mmap_sem);
 		       		break;
+			}
 
 			maddr = kmap_atomic(pg, KM_USER0);
 			memcpy(maddr + offset, from, len);

_
