git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "René Scharfe" <l.s.r@web.de>,
	"Ori Bernstein" <ori@eigenstate.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] Avoid infinite loop in malformed packfiles
Date: Mon, 24 Aug 2020 16:52:31 -0400	[thread overview]
Message-ID: <20200824205231.GA787628@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq5z974w50.fsf@gitster.c.googlers.com>

On Mon, Aug 24, 2020 at 01:38:35PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I think it may be worth making this a configurable value
> > (core.maxDeltaDepth or something). Nobody would generally need to tweak
> > it, but it would give an escape hatch for getting people out of a broken
> > situation ("git -c core.maxDeltaDepth=50000 repack" or similar).
> 
> ... meaning "the pack I have has overlong delta chains to read, and
> I am running repack to cut these chains down to more manageable
> level"?  Makes sense.

Exactly.

> As it may be a bit tricky to figure out where we should read such a
> configuration for those who are new to our codebase, here is an
> illustration to give a starting point.  Docs and tests are probably
> needed, too.

It may be hard to test, as I suspect modern versions of Git are not
happy to create such a deep chain. We could test with a lowered value of
the config option, though.

It may also be worth introducing a true cycle using non-git commands.
There's some coverage there in t/t5309-pack-delta-cycles.sh. I think we
were mainly concerned there with how index-pack treats them, and it
would be nice to see how other commands react. Though I guess that
creates another testing difficulty: those other commands would need a
pack index, and we'd refuse to create one. :) So I think it would
require adding code to manually create a bogus idx file (or I guess
shipping one as a fixture).

-Peff

  reply	other threads:[~2020-08-24 20:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-23  0:52 [PATCH] Avoid infinite loop in malformed packfiles Ori Bernstein
2020-08-23  2:52 ` ori
2020-08-23  3:08 ` Eric Sunshine
2020-08-23  3:11 ` Ori Bernstein
2020-08-23  6:26   ` René Scharfe
2020-08-23 20:41     ` Ori Bernstein
2020-08-24 16:06       ` René Scharfe
2020-08-24 20:12         ` Jeff King
2020-08-24 20:38           ` Junio C Hamano
2020-08-24 20:52             ` Jeff King [this message]
2020-08-24 21:22               ` Junio C Hamano
2020-08-30  3:33                 ` ori
2020-08-30 10:56                   ` René Scharfe
2020-08-30 16:15                     ` Junio C Hamano
2020-08-31  9:29                       ` Jeff King
2020-08-31 16:32                         ` Junio C Hamano
2020-08-31 19:23                           ` Jeff King
2020-08-31 16:50                         ` ori
2020-08-24 17:33   ` Junio C Hamano
2020-08-24 20:30 ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200824205231.GA787628@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=ori@eigenstate.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).