public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: DervishD <raul@pleyades.net>
To: Linux-kernel <linux-kernel@vger.kernel.org>
Cc: Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [PATCH][TRIVIAL] mmap.c corner case fix
Date: Tue, 14 Jan 2003 10:39:02 +0100	[thread overview]
Message-ID: <20030114093902.GA225@DervishD> (raw)

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

    Hi Marcelo :)

    This patch fixes a corner case on the mmap() syscall.

    The patch is from David S. Miller, not me. My patch was
incomplete and did nothing on 'big TASK_SIZE' architectures.

    The patch is against both 2.4.20 and 2.4.21-pre, is just the same.
Please apply. I sent you the incomplete patch at pre-1 and this bug
is getting older by the minute ;))

    Thanks :)

    Raúl

[-- Attachment #2: mmap.c.diff for 2.4.20 and 2.4.21-pre --]
[-- Type: text/plain, Size: 407 bytes --]

--- linux/mm/mmap.c.orig	2002-12-11 13:59:37.000000000 +0100
+++ linux/mm/mmap.c	2002-12-11 14:01:16.000000000 +0100
@@ -403,10 +403,12 @@
 	if (file && (!file->f_op || !file->f_op->mmap))
 		return -ENODEV;
 
-	if ((len = PAGE_ALIGN(len)) == 0)
+	if (!len)
 		return addr;
 
-	if (len > TASK_SIZE)
+	len = PAGE_ALIGN(len);
+
+	if (len > TASK_SIZE || len == 0)
 		return -EINVAL;
 
 	/* offset overflow? */

                 reply	other threads:[~2003-01-14  9:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030114093902.GA225@DervishD \
    --to=raul@pleyades.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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