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

Re: [PATCH] tree-walk: disallow overflowing modes

From
Jeff King <peff@peff.net>
Date
Jan 26, 2023, 11:36 UTC
Message-ID
<Y9JlouutFD21lvna@coredump.intra.peff.net>
In-Reply-To
<xmqqmt67fysf.fsf@gitster.g>
On Tue, Jan 24, 2023 at 12:44:16PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> René Scharfe <l.s.r@web.de> writes:
> 
> > ...  It's basically harmless.  Perhaps
> > we just need a comment stating that, to contain the urge to "fix" this.
> 
> Yeah, especially since fsck finds and warns about bad mode with
> FSCK_MSG_BAD_FILEMODE and also FSCK_MSG_ZERO_PADDED_FILEMODE in a
> separate codepath, adding another piece of code that checks a
> slightly different condition does not sound like a good idea.

Yeah, I'm happy to drop this whole thing. I do think it would be reasonable for fsck to check for overflow alongside BAD_FILEMODE, etc, but it's annoying to do since we are relying on the existing parser.

I actually have a suspicion that it might be reasonable for fsck to just parse the trees itself, rather than relying on decode_tree_entry(), etc. But that's a much bigger topic (and a possible maintenance burden) for questionable gain, so unless we find some compelling reason (some case that we really want to detect but which we want the regular decoder to ignore), it's probably not worth exploring.

-Peff
Previous: Junio C Hamano
Message 9 of 9 in “tree-walk: disallow overflowing modes”
  1. tree-walk: disallow overflowing modesRené Scharfe, Jan 21, 2023
  2. Jeff KingJan 22, 2023
  3. René ScharfeJan 22, 2023
  4. Junio C HamanoJan 22, 2023
  5. Jeff KingJan 22, 2023
  6. Ævar Arnfjörð BjarmasonJan 23, 2023
  7. René ScharfeJan 24, 2023
  8. Junio C HamanoJan 24, 2023
  9. Jeff KingJan 26, 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.