public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: DervishD <raul@pleyades.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux-kernel <linux-kernel@vger.kernel.org>, davem@redhat.com
Subject: [PATCH] mmap.c - do_mmap_pgoff() small correction
Date: Wed, 11 Dec 2002 14:32:46 +0100	[thread overview]
Message-ID: <20021211133246.GE48@DervishD> (raw)

[-- 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;

             reply	other threads:[~2002-12-11 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 13:32 DervishD [this message]
2003-02-11  9:41 ` [RESEND][PATCH] mmap.c - do_mmap_pgoff() small correction DervishD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021211133246.GE48@DervishD \
    --to=raul@pleyades.net \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox