From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
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 11:11:53 +0100 [thread overview]
Message-ID: <ZWB26TH0CFW1KC4L@tanuki> (raw)
In-Reply-To: <xmqqy1en7af2.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]
On Fri, Nov 24, 2023 at 06:44:33PM +0900, Junio C Hamano wrote:
> 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?
Sorry, this was a typo on my part. I didn't mean "revision", I meant
"reference" here. References are limited to at most 4kB on most
platforms due to filesystem limitations, whereas revisions currently
have no limits in place.
Patrick
> 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.
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-11-24 10:12 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
2023-11-24 10:11 ` Patrick Steinhardt [this message]
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=ZWB26TH0CFW1KC4L@tanuki \
--to=ps@pks.im \
--cc=antaigroupltda@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--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.
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).