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

Re: [PATCH 2/4] make verify_one_pack() a bit less wrong wrt packed_git structure

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2008, 05:59 UTC
Message-ID
<7vk5kn7znz.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1204176320-31358-3-git-send-email-nico@cam.org>
Nicolas Pitre <nico@cam.org> writes:
> ..., but it is still
> a bit more "correct" to leak it implicitly rather than explicitly.

I do not follow this logic to debate which incorrectness is more correct, but I do not mind the removal of free() there.

I am not sure about the install_packed_git() piece, though.

This part of the code predates Shawn's windowed mmap and all other recent code improvements, but the original motivation of not installing the pack was to make sure that codepaths outside verify_packfile() would not see the objects from the pack being verified at all. IOW, the omission originally was intentional.

I just quickly looked at verify_packfile() after applying your series, and it seems that nothing tries to access objects with only their SHA-1 names without explicitly telling which pack to read from, so it should still be safe even if we did not install the packed git (iow, the normal codepath would not try to pick up objects from the suspect pack that is being validated).

But it made me feel a bit worried.
Previous: Nicolas PitreNext: Nicolas Pitre
Message 6 of 8 in “enhancements to 'git verify-pack'”
  1. 0/4 enhancements to 'git verify-pack'Nicolas Pitre, Feb 28, 2008
  2. 1/4 factorize revindex code out of builtin-pack-objects.cNicolas Pitre, Feb 28, 2008
  3. 2/4 make verify_one_pack() a bit less wrong wrt packed_git structureNicolas Pitre, Feb 28, 2008
  4. 3/4 fix unimplemented packed_object_info_detail() featuresNicolas Pitre, Feb 28, 2008
  5. 4/4 add storage size output to 'git verify-pack -v'Nicolas Pitre, Feb 28, 2008
  6. Junio C HamanoMar 1, 2008
  7. Nicolas PitreMar 1, 2008
  8. Junio C HamanoMar 1, 2008

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.