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

Re: [PATCH 2/2] packfile: fix corruption due to stale delta base cache entries

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 7, 2026, 18:00 UTC
Message-ID
<xmqqcxtl8k6f.fsf@gitster.g>
In-Reply-To
<20261007081844.GA606386@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 18 quoted lines
> Ah, I get it now. It is a little funny to key the hash on the in-core
> pointer we happen to have, but it does provide a certain uniqueness. I
> suspect that doing this would be mostly correct:
> ...
> and would trigger the use-after-free, but:
>
>   1. It introduces weird semantic questions, like: what if you freed and
>      then reopened a pack of the same name and it didn't have the same
>      contents?
>
>   2. It's more expensive.
>
>   3. Changing the bug from "hard to detect hash equality mismatch" to
>      "undefined behavior" is not really much of an improvement. ;)
>
> So I think just fixing the bug is good, along with accepting that it
> only triggered in certain specific cases and testing that. And your
> patch looks like the obviously correct fix.
Thanks for writing and reviewing, all.  Very much appreciated.
Let me mark the topic for 'next'.
Previous: Jeff KingNext: Patrick Steinhardt
Message 13 of 18 in “packfile: fix corruption due to stale delta base cache entries”
  1. 0/2 packfile: fix corruption due to stale delta base cache entriesPatrick Steinhardt, Oct 2, 2026
  2. 1/2 packfile: move around `close_pack()`Patrick Steinhardt, Oct 2, 2026
  3. Mark C. Chu-CarrollOct 2, 2026
  4. Patrick SteinhardtOct 2, 2026
  5. 2/2 packfile: fix corruption due to stale delta base cache entriesPatrick Steinhardt, Oct 2, 2026
  6. Guillaume ChauvelOct 2, 2026
  7. Patrick SteinhardtOct 2, 2026
  8. Philippe BlainOct 2, 2026
  9. Patrick SteinhardtOct 2, 2026
  10. Jeff KingOct 2, 2026
  11. Patrick SteinhardtOct 5, 2026
  12. Jeff KingOct 7, 2026
  13. Junio C HamanoOct 7, 2026
  14. 0/2 packfile: fix corruption due to stale delta base cache entriesPatrick Steinhardt, Oct 6, 2026
  15. 1/2 packfile: move around `close_pack()`Patrick Steinhardt, Oct 6, 2026
  16. 2/2 packfile: fix corruption due to stale delta base cache entriesPatrick Steinhardt, Oct 6, 2026
  17. Junio C HamanoOct 6, 2026
  18. Patrick SteinhardtOct 7, 2026

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.