From: "René Scharfe" <l.s.r@web.de>
To: ori@eigenstate.org, gitster@pobox.com, peff@peff.net
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Avoid infinite loop in malformed packfiles
Date: Sun, 30 Aug 2020 12:56:11 +0200 [thread overview]
Message-ID: <59efeeab-49de-17e7-8b1c-355d6ef31b5d@web.de> (raw)
In-Reply-To: <A1CA9D499EDDACBA275BA61E114645F0@eigenstate.org>
Am 30.08.20 um 05:33 schrieb ori@eigenstate.org:
>> Jeff King <peff@peff.net> writes:
>>
>>> 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.
>>
>> Yes, that was what I meant. Start from a 1KB text, create 50
>> revisions of the file by adding a single line at its end at a time,
>> pack with depth limit of 100, and then see "git log -p" die when the
>> allowed max lowered to 10, or something like that.
>
> Sorry about the delay -- most of my time to poke at this is over the weekend.
>
> Will that work? I'd expect that modern pack files end up being
> offset deltas, rather than reference deltas.
True, but going down all the way would work:
diff --git a/t/t5316-pack-delta-depth.sh b/t/t5316-pack-delta-depth.sh
index 0f06c40eb1..7fd21cd3ce 100755
--- a/t/t5316-pack-delta-depth.sh
+++ b/t/t5316-pack-delta-depth.sh
@@ -94,4 +94,15 @@ test_expect_success '--depth limits depth' '
test_i18ncmp expect actual
'
+test_expect_success 'maxAllowedDeltaDepth is respected' '
+ git clone . clone1 &&
+ (
+ cd clone1 &&
+ git repack -a -d &&
+ test_config core.maxAllowedDeltaDepth 0 &&
+ test_must_fail git fsck 2>err &&
+ test_i18ngrep "overlong delta chain" err
+ )
+'
+
test_done
next prev parent reply other threads:[~2020-08-30 10:58 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
2020-08-24 21:22 ` Junio C Hamano
2020-08-30 3:33 ` ori
2020-08-30 10:56 ` René Scharfe [this message]
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=59efeeab-49de-17e7-8b1c-355d6ef31b5d@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ori@eigenstate.org \
--cc=peff@peff.net \
/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).