linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@redhat.com>
To: David Ashley <dash@xdr.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: mmap wrapping around to 0 revisited
Date: Tue, 5 Mar 2002 15:47:39 -0500	[thread overview]
Message-ID: <20020305154739.C432@redhat.com> (raw)
In-Reply-To: <200203041605.g24G5Ts15070@xdr.com>; from dash@xdr.com on Mon, Mar 04, 2002 at 08:05:29AM -0800


On Mon, Mar 04, 2002 at 08:05:29AM -0800, David Ashley wrote:
> The fix is in
> arch/ppc/kernel/syscalls.c
> in the sys_mmap function, change this line:
> 	err = do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
> to
> 	err = do_mmap2(addr, len, prot, flags, fd, (unsigned long)offset >> PAGE_SHIFT);
>
> Possibly it would be better to have the argument as an unsigned long instead
> of an off_t.

Wrong fix.  sys_mmap on ppc should really be using do_mmap which already
includes the cast to unsigned long and checks for overflow.  Arguably,
it could well check for -'ve offsets and reject them, but traditionally
Linux has accepted up to 4GB offsets with its 32 bit APIs and changing
this would break a few things like X.

		-ben

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2002-03-05 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-04 16:05 mmap wrapping around to 0 revisited David Ashley
2002-03-05 20:47 ` Benjamin LaHaise [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-06  0:06 David Ashley
2002-03-05 23:58 ` Dan Malek
2002-03-07  2:37 David Ashley

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=20020305154739.C432@redhat.com \
    --to=bcrl@redhat.com \
    --cc=dash@xdr.com \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).