git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Andy Isaacson <adi@hexapodia.org>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: git hang with corrupted .pack
Date: Wed, 14 Oct 2009 12:42:39 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.0910141234540.20122@xanadu.home> (raw)
In-Reply-To: <20091014161259.GK9261@spearce.org>

On Wed, 14 Oct 2009, Shawn O. Pearce wrote:

> Nicolas Pitre <nico@fluxnic.net> wrote:
> > > Some types of corruption to a pack may confuse the deflate stream
> > > which stores an object.  In Andy's reported case a 36 byte region
> > > of the pack was overwritten, leading to what appeared to be a valid
> > > deflate stream that was trying to produce a result larger than our
> > > allocated output buffer could accept.
> ...
> > This is unfortunate that making a test case for this isn't exactly 
> > trivial.
> 
> Hmmm.  We could do something like manually create a pack file of
> one non-delta blob whose pack header length is 16, but use a zlib
> stream whose result body is 64.  Prior to this fix, we'd be stuck
> in the infinite loop.  :-)

Ah, of course.

> Its a PITA to create though, you have to hand-craft the test vector
> and save it in the repository, we can't produce such a pack with
> any real code we ship.

Can be done easily with dd though, see do_corrupt_object() in t5303 for 
example.


Nicolas

  reply	other threads:[~2009-10-14 17:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14  4:22 git hang with corrupted .pack Andy Isaacson
2009-10-14 14:23 ` Shawn O. Pearce
2009-10-14 16:09   ` Nicolas Pitre
2009-10-14 16:12     ` Shawn O. Pearce
2009-10-14 16:42       ` Nicolas Pitre [this message]
2009-10-14 18:03         ` Shawn O. Pearce
2009-10-14 18:39           ` Nicolas Pitre
2009-10-15  7:39             ` Junio C Hamano
2009-10-20 15:14               ` Alex Riesen
2009-10-20 15:23                 ` Sverre Rabbelier
2009-10-20 15:36                   ` Alex Riesen
2009-10-26  2:35                 ` Junio C Hamano
2009-10-26  7:07                   ` Alex Riesen
2009-10-26 14:23                   ` Shawn O. Pearce
2009-11-03 21:31                 ` Pascal Obry
2009-11-03 22:28                   ` Shawn O. Pearce
2009-11-03 22:34                     ` Pascal Obry
2009-10-20 16:52   ` Junio C Hamano
2009-10-20 17:13     ` Junio C Hamano
2009-10-20 19:33       ` Junio C Hamano
2009-10-20 19:46         ` Nicolas Pitre
2009-10-20 20:50           ` Junio C Hamano
2009-10-22  6:06             ` Junio C Hamano

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=alpine.LFD.2.00.0910141234540.20122@xanadu.home \
    --to=nico@fluxnic.net \
    --cc=adi@hexapodia.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.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).