mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolinux.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: Linux kernel development list <linux-kernel@vger.kernel.org>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	torvalds@transmeta.com
Subject: Re: [CHECKER] 84 bugs in 2.4.4/2.4.4-ac8 where NULL pointers are deref'd
Date: Wed, 30 May 2001 00:49:35 -0600 (MDT)	[thread overview]
Message-ID: <200105300649.f4U6naMl021300@webber.adilger.int> (raw)
In-Reply-To: <Pine.GSO.4.21.0105300134520.12645-100000@weyl.math.psu.edu> "from Alexander Viro at May 30, 2001 01:45:00 am"

Al Viro writes:
> On Tue, 29 May 2001, Andreas Dilger wrote:
> > For ext2 it is pretty much the same, except ext2_delete_entry() called
> > ext2_check_dir_entry() with a NULL input (for some reason), but it could
> > easily supply a valid input value.  All callers to ext2_delete_entry()
> > dereference the dir parameter before calling ext2_delete_entry().  All
> > other paths dereference dir before ext2_check_dir_entry() is called.
> 
> Wrong fix. It
> 	a) doesn't close all potential problems (think what happens if you
> run too close to the end of buffer)

No, it doesn't fix all the problems of ext2.  It fixes only this one issue.

> 	b) doesn't fix anything that could be triggered - ext2_delete_entry()
> can happen only if you've already done lookup. I.e. no problems had been
> found in that block back when we were finding the entry.

That means there is no need to check dir in ext2_check_dir_entry(),
is there?  If all callers to ext2_delete_entry() already verify the
buffer in ext2_find_entry() (which they appear to do), then there is
no point in calling ext2_check_dir_entry() at all.

> 	c) makes ugly code uglier.

Did you even look at the patch?  I didn't ADD extra checks, I REMOVED the
(useless) checking for dir == NULL in ext2_check_dir_entry().  How can
that be "uglier"?

> 	d) real fix exists and got a lot of testing over that last 5 months.

Yes, I know all about it, I need it as part of the ext2 indexed directory
code.  That doesn't mean your directory-in-pagecache will make it in to
2.4, so may as well fix the minor "problem" that exists now (it is not a
BUG, but a waste of a few cycles in a function that is called a LOT).

If your patch makes it into 2.4 then even better.  If not, then my fix is
still better than leaving it as is, and it is "obviously correct" while
your patch changes a LOT of code.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

  reply	other threads:[~2001-05-30  6:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-29 21:49 Dawson Engler
2001-05-29 22:36 ` Alexander Viro
2001-05-29 22:36 ` David S. Miller
2001-05-29 22:56   ` Steve Whitehouse
2001-05-29 23:09   ` Dawson Engler
2001-05-30  5:17 ` Andreas Dilger
2001-05-30  5:45   ` Alexander Viro
2001-05-30  6:49     ` Andreas Dilger [this message]
2001-05-30  6:58       ` Alexander Viro

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=200105300649.f4U6naMl021300@webber.adilger.int \
    --to=adilger@turbolinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=tytso@mit.edu \
    --cc=viro@math.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

all inboxes | Powered by JetHome®