From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jacek Wielemborek <d33tah@gmail.com>, git@vger.kernel.org
Subject: Re: Segmentation fault found while fuzzing .pack file under 2.7.0.rc3
Date: Wed, 24 Feb 2016 06:05:48 -0500 [thread overview]
Message-ID: <20160224110548.GA21620@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqtwmp2e6d.fsf@gitster.mtv.corp.google.com>
On Thu, Jan 07, 2016 at 02:54:50PM -0800, Junio C Hamano wrote:
> We do not check if the offset of individual objects are within the
> corresponding .pack file, either, and nth_packed_object_offset()
> does return the data read from .idx file that is not checked for
> sanity. use_pack(), which is the helper used by the callers of
> nth_packed_object_offset() that finds the offset in the packfile for
> each object, avoids allowing a read access to mapped pack data
> beyond the end of it, so it is OK to return bogus value that was
> read from the .idx file from this function, but there is one
> computation the function itself does using a possibly bogus value
> read from the disk: to find out where in the secondary offset table
> in the .idx file the offset in the packfile is stored.
Looks like this topic got dropped. I was reminded of it when somebody
pointed me to a similar case[1] today which segfaults in a similar way (but
this time was caused by actual filesystem corruption).
Did you ever push the patch below further along?
I confirmed that your patch detects and complains on this newer case.
Though I think there is another similar problem in
read_v2_anomalous_offsets (I haven't dug, but it triggers for me in
"index-pack --verify").
-Peff
[1] https://github.com/libgit2/libgit2/issues/3556
next prev parent reply other threads:[~2016-02-24 11:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-05 13:44 Segmentation fault found while fuzzing .pack file under 2.7.0.rc3 Jacek Wielemborek
2016-01-05 15:24 ` Jeff King
2016-01-06 0:23 ` Jonathan Nieder
2016-01-06 7:23 ` Jeff King
2016-01-06 9:27 ` Jacek Wielemborek
2016-01-06 9:46 ` Duy Nguyen
2016-01-06 12:51 ` Jacek Wielemborek
2016-01-07 19:37 ` Junio C Hamano
2016-01-07 22:54 ` Junio C Hamano
2016-01-11 21:33 ` Jeff King
2016-02-24 11:05 ` Jeff King [this message]
2016-02-24 18:48 ` Junio C Hamano
2016-02-25 14:12 ` Jeff King
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=20160224110548.GA21620@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=d33tah@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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;
as well as URLs for NNTP newsgroup(s).