public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmap.c - do_mmap_pgoff() small correction
@ 2002-12-11 13:32 DervishD
  2003-02-11  9:41 ` [RESEND][PATCH] " DervishD
  0 siblings, 1 reply; 2+ messages in thread
From: DervishD @ 2002-12-11 13:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux-kernel, davem

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

    Hi Linus :)

    This is a correction for a patch I sent you that you included in
the 2.5.x tree. The patch I sent you fixed a corner case for the
mmap() syscall, where the requested size was too big (namely, bigger
than SIZE_MAX-PAGE_SIZE). Unfortunately, the patch did a wrong
assumption that is not true in some archs where TASK_SIZE is the full
address space available, as sparc64. So, the patch didn't fix
anything on those archs :((

    David S. Miller <davem@redhat.com> pointed this and made this new
patch that fixes the spot. Now it should work in all archs.

    If you have any doubt, just tell.

    Raúl

[-- Attachment #2: mmap.c.diff --]
[-- Type: text/plain, Size: 472 bytes --]

--- linux/mm/mmap.c.orig	2002-12-11 14:27:04.000000000 +0100
+++ linux/mm/mmap.c	2002-12-11 14:28:09.000000000 +0100
@@ -421,14 +421,14 @@
 	if (file && (!file->f_op || !file->f_op->mmap))
 		return -ENODEV;
 
-	if (!len)
+	if (len == 0)
 		return addr;
 
-	if (len > TASK_SIZE)
-		return -EINVAL;
-
 	len = PAGE_ALIGN(len);
 
+	if (len > TASK_SIZE || len == 0)
+		return -EINVAL;
+
 	/* offset overflow? */
 	if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
 		return -EINVAL;

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

end of thread, other threads:[~2003-02-11  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-11 13:32 [PATCH] mmap.c - do_mmap_pgoff() small correction DervishD
2003-02-11  9:41 ` [RESEND][PATCH] " DervishD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox