9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Erik Dalén" <dalen@socialisterna.org>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] Bounds checking bug in fcall(2) functions
Date: Sat, 10 Nov 2007 00:01:30 +0100	[thread overview]
Message-ID: <815f4e4b0711091501v53a37569x5c5f576623fb9547@mail.gmail.com> (raw)
In-Reply-To: <15aabbdb3c4953608a4f19497b3bffb0@terzarima.net>

On 11/9/07, Charles Forsyth <forsyth@terzarima.net> wrote:
> > For example in convM2D() it sets ebuf as:
> > ebuf = buf + nbuf;
> >
> > and then checks if reads will go past ebuf. But ebuf will point to the
> > first byte after the buffer, so past ebuf will include the byte after
> > the buffer. So it can potentially try to read of write to one byte
> > past the buffer in all these functions.
>
> it would if it tries to access that byte but it doesn't in convM2D.c or convD2M.c
> it's checking that the resulting pointer after accessing the bytes will still be <= ebuf,
> which (i think) is correct.
>

On second thought I think you are correct. At the end of the function
the pointer might be one byte past the buffer size, but then it won't
do any reads or writes (But it could be a problem if the buffer is
right at the end of the virtual memory space :). Sorry about the buggy
bug report.

-- 
Erik Dalén
dalen@socialisterna.org

  reply	other threads:[~2007-11-09 23:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-09 22:20 Erik Dalén
2007-11-09 22:42 ` Charles Forsyth
2007-11-09 23:01   ` Erik Dalén [this message]
2007-11-09 23:41     ` Charles Forsyth
2007-11-10 17:55     ` Russ Cox
2007-11-16 10:18     ` [9fans] Bounds checking bug ifcall(2) functions Douglas A. Gwyn
2007-11-16 10:38       ` erik quanstrom
2007-11-19 10:14         ` Douglas A. Gwyn

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=815f4e4b0711091501v53a37569x5c5f576623fb9547@mail.gmail.com \
    --to=dalen@socialisterna.org \
    --cc=9fans@cse.psu.edu \
    /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).