linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Missing up_read after get_user_pages in arch/i386/lib/usercopy.c?
@ 2003-12-18  5:02 Mark Frazer
  2003-12-18  5:25 ` Linus Torvalds
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Frazer @ 2003-12-18  5:02 UTC (permalink / raw)
  To: Linux Kernel List

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

===== arch/i386/lib/usercopy.c 1.15 vs edited =====
--- 1.15/arch/i386/lib/usercopy.c	Thu Aug 21 01:31:58 2003
+++ edited/arch/i386/lib/usercopy.c	Wed Dec 17 23:59:16 2003
@@ -541,8 +541,10 @@
 				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);


-- 
Like most of life's problems, this one can be solved with bending. - Bender

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Missing up_read after get_user_pages in arch/i386/lib/usercopy.c?
  2003-12-18  5:02 Missing up_read after get_user_pages in arch/i386/lib/usercopy.c? Mark Frazer
@ 2003-12-18  5:25 ` Linus Torvalds
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Torvalds @ 2003-12-18  5:25 UTC (permalink / raw)
  To: Mark Frazer; +Cc: Linux Kernel List



On Thu, 18 Dec 2003, Mark Frazer wrote:
>
> Just browsing users of get_user_pages today and noticed what might be a
> bug.

Looks like it. It can only hit old 80386 machines (that code is disabled
by any CPU with a i486 MMU or better), and even then only when somebody
does something silly, but yeah, looks like a real bug.

		Linus

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-18  5:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-18  5:02 Missing up_read after get_user_pages in arch/i386/lib/usercopy.c? Mark Frazer
2003-12-18  5:25 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).