git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] object-name: reject too-deep recursive ancestor queries

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 24, 2023, 10:11 UTC
Message-ID
<ZWB26TH0CFW1KC4L@tanuki>
In-Reply-To
<xmqqy1en7af2.fsf@gitster.g>
On Fri, Nov 24, 2023 at 06:44:33PM +0900, Junio C Hamano wrote:
Show 18 quoted lines
> 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
Show 7 quoted lines
> 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.
> 
Previous: Junio C HamanoNext: Jeff King
Message 5 of 7 in “object-name: reject too-deep recursive ancestor queries”
  1. object-name: reject too-deep recursive ancestor queriesTaylor Blau, Nov 20, 2023
  2. Junio C HamanoNov 20, 2023
  3. Patrick SteinhardtNov 23, 2023
  4. Junio C HamanoNov 24, 2023
  5. Patrick SteinhardtNov 24, 2023
  6. Jeff KingDec 6, 2023
  7. Patrick SteinhardtDec 7, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.