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

Re: [PATCH 1/9] close another possibility for propagating pack corruption

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2008, 08:46 UTC
Message-ID
<7vod11884o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1225321372-6570-2-git-send-email-nico@cam.org>
Nicolas Pitre <nico@cam.org> writes:
Show 5 quoted lines
> Abstract
> --------
>
> With index v2 we have a per object CRC to allow quick and safe reuse of
> pack data when repacking.  this, however, doesn't currently prevent a
s/this/This/;
Show 8 quoted lines
> stealth corruption from being propagated into a new pack when _not_
> reusing pack data as demonstrated by the modification to t5302 included
> here.
>
> The Context
> -----------
>
> The Git database is all checksumed with SHA1 hashes.  Any kind of
s/checksumed/checksummed/;
Show 6 quoted lines
> ...
> What about the streamed pack case?  Well, any client receiving a pack
> must always consider that pack as untrusty and perform full validation
> anyway, hence no such stealth corruption could be propagated to remote
> repositoryes already.  It is therefore worthless doing local validation
> in that case.

Very nicely done. I've never seen a commit message that needs its own Abstract ;-)

Show 10 quoted lines
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index 59c30d1..0366277 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -1689,6 +1689,8 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo
>  	return 0;
>  }
>  
> +extern int do_check_packed_object_crc;
> +

This ought to belong to cache.h or some other header file. Perhaps you did this to avoid unnecessary recompilation (we've discussed this at GitTogether)?

Show 9 quoted lines
> @@ -1697,6 +1699,16 @@ static void prepare_pack(int window, int depth)
>  
>  	get_object_details();
>  
> +	/*
> +	 * If we're locally repacking then we need to be doubly careful
> +	 * from now on in order to make sure no stealth corruption gets
> +	 * propagated to the new pack.  Clients receiving streamed packs
> +	 * should validate everything they get anyway so no need to incure
s/incure/incur/;
Previous: Nicolas PitreNext: Nicolas Pitre
Message 11 of 12 in “more robustness against pack corruptions”
  1. 0/9 more robustness against pack corruptionsNicolas Pitre, Oct 29, 2008
  2. 1/9 close another possibility for propagating pack corruptionNicolas Pitre, Oct 29, 2008
  3. 2/9 better validation on delta base object offsetsNicolas Pitre, Oct 29, 2008
  4. 3/9 make unpack_object_header() non fatalNicolas Pitre, Oct 29, 2008
  5. 4/9 make packed_object_info() resilient to pack corruptionsNicolas Pitre, Oct 29, 2008
  6. 5/9 make check_object() resilient to pack corruptionsNicolas Pitre, Oct 29, 2008
  7. 6/9 make find_pack_revindex() aware of the nasty worldNicolas Pitre, Oct 29, 2008
  8. 7/9 pack-objects: allow "fixing" a corrupted pack without a full repackNicolas Pitre, Oct 29, 2008
  9. 8/9 extend test coverage for latest pack corruption resilience improvementsNicolas Pitre, Oct 29, 2008
  10. 9/9 pack-objects: don't leak pack window reference when splitting packsNicolas Pitre, Oct 29, 2008
  11. Junio C HamanoOct 31, 2008
  12. Nicolas PitreOct 31, 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.