All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Haggerty <mhagger@alum.mit.edu>
To: kusmabite@gmail.com
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] Set hard limit on delta chain depth
Date: Tue, 06 Dec 2011 15:54:13 +0100	[thread overview]
Message-ID: <4EDE2C95.5040804@alum.mit.edu> (raw)
In-Reply-To: <CABPQNSaE=TWGbBRMnthEuT181=XbOafPfgx88_JQnnQ6TiYyqw@mail.gmail.com>

On 12/06/2011 01:17 PM, Erik Faye-Lund wrote:
> 2011/12/5 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
>> Too deep delta chains can cause stack overflow in get_base_data(). Set
>> a hard limit so that index-pack does not run out of stack. Also stop
>> people from producing such a long delta chains using "pack-object
>> --depth=<too large>"
>>
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>> ---
>>  I used to make very long delta chains and triggered this in index-pack.
>>  I did not care reporting because it's my fault anyway. Think again,
>>  index-pack is called at server side and a malicious client can
>>  trigger this. This patch does not improve the situation much, but at
>>  least we won't get sigsegv at server side.
> 
> Wouldn't it make more sense to make the limit a config option rather
> than a hard-coded value of 128 (which seems arbitrary to me)? After
> all, different platforms have different stack-limitations...

I'm confused: is the data only ever read by the same host that generated
it?  Because if not, then the "creator" had better never be configured
to use a chain depth that the "reader" cannot handle.  This in turn
imply that there should be a common limit that is supported by all git
clients and is a documented part of the protocol.  (Or the code has to
be rewritten to use an explicit stack instead of recursion.)

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

  parent reply	other threads:[~2011-12-06 14:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  7:04 [PATCH] Set hard limit on delta chain depth Nguyễn Thái Ngọc Duy
2011-12-06 12:17 ` Erik Faye-Lund
2011-12-06 12:32   ` Nguyen Thai Ngoc Duy
2011-12-06 12:41     ` Erik Faye-Lund
2011-12-06 12:48       ` Nguyen Thai Ngoc Duy
2011-12-06 14:54   ` Michael Haggerty [this message]
2011-12-06 15:30     ` Nguyen Thai Ngoc Duy
2011-12-06 18:12       ` Shawn Pearce
2011-12-06 18:56         ` Jeff King
2011-12-06 15:06 ` Junio C Hamano
2011-12-06 15:45   ` Nguyen Thai Ngoc Duy
2011-12-10  0:02     ` Junio C Hamano
2011-12-07 17:50   ` [PATCH] index-pack: eliminate unlimited recursion in get_delta_base() Nguyễn Thái Ngọc Duy
2011-12-08  3:02     ` Shawn Pearce
2011-12-08 11:06       ` Nguyen Thai Ngoc Duy
2011-12-08 13:40       ` [PATCH 1/2] index_pack: indent find_unresolved_detals one level pclouds
2011-12-09 21:27         ` Junio C Hamano
     [not found]       ` <1323351638-4790-1-git-send-email-y>
2011-12-08 13:40         ` [PATCH 2/2] index-pack: a naive attempt to flatten find_unresolved_deltas pclouds
2011-12-08 16:42           ` Shawn Pearce

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=4EDE2C95.5040804@alum.mit.edu \
    --to=mhagger@alum.mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kusmabite@gmail.com \
    --cc=pclouds@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.