git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: "Taylor Blau" <me@ttaylorr.com>,
	git@vger.kernel.org, "Jeff King" <peff@peff.net>,
	"Carlos Andrés Ramírez Cataño" <antaigroupltda@gmail.com>
Subject: Re: [PATCH] object-name: reject too-deep recursive ancestor queries
Date: Fri, 24 Nov 2023 18:44:33 +0900	[thread overview]
Message-ID: <xmqqy1en7af2.fsf@gitster.g> (raw)
In-Reply-To: <ZV9Za7iCL6WiE-Py@tanuki> (Patrick Steinhardt's message of "Thu, 23 Nov 2023 14:53:47 +0100")

Patrick Steinhardt <ps@pks.im> writes:

> I have to wonder whether we should tighten restrictions even further:
> instead of manually keeping track of how deep in the stack we are, we
> limit the length of revisions to at most 1MB. I would claim that this
> limit is sufficiently large to never be a problem in practice.

Tempting.

> Revisions
> are limited to 4kB on most platforms anyway due to the maximum path
> length.

I do not quite get this part, though.

When we get "HEAD~~~~~~~~~^2~~~~~~" from the user, do we somehow try
to create a file or a directory with that name and fail due to
ENAMETOOLONG?

There are ways like "git rev-list --stdin" to cause Git read input
lines of arbitrary length, so I do not think the command line length
limit does not come into the picture, either.

But I do agree that the only useful use of such a revision string
that is longer than 1MB would be to attack.


  reply	other threads:[~2023-11-24  9:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 16:13 [PATCH] object-name: reject too-deep recursive ancestor queries Taylor Blau
2023-11-20 17:14 ` Junio C Hamano
2023-11-23 13:53 ` Patrick Steinhardt
2023-11-24  9:44   ` Junio C Hamano [this message]
2023-11-24 10:11     ` Patrick Steinhardt
2023-12-06 19:40       ` Jeff King
2023-12-07  6:52         ` Patrick Steinhardt

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=xmqqy1en7af2.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=antaigroupltda@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=peff@peff.net \
    --cc=ps@pks.im \
    /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).