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

Re: [PATCH] delta-islands: fix segfault when freeing island marks

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 16, 2023, 17:36 UTC
Message-ID
<xmqqfsb5qzqj.fsf@gitster.g>
In-Reply-To
<61e490595b80b34c55fd640e093e021ff6fa9591.1676542973.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 13 quoted lines
> In 647982bb71 (delta-islands: free island_marks and bitmaps, 2023-02-03)
> we have introduced logic to free `island_marks` in order to reduce heap
> memory usage in git-pack-objects(1). This commit is causing segfaults in
> the case where this Git command does not load delta islands at all, e.g.
> when reading object IDs from standard input. One such crash can be hit
> when using repacking multi-pack-indices with delta islands enabled.
>
> The root cause of this bug is that we unconditionally dereference the
> `island_marks` variable even in the case where it is a `NULL` pointer,
> which is fixed by making it conditional. Note that we still leave the
> logic in place to set the pointer to `-1` to detect use-after-free bugs
> even when there are no loaded island marks at all.
> ---
Missing sign-off?
Previous: Eric WongNext: Patrick Steinhardt
Message 3 of 7 in “delta-islands: fix segfault when freeing island marks”
  1. delta-islands: fix segfault when freeing island marksPatrick Steinhardt, Feb 16, 2023
  2. Eric WongFeb 16, 2023
  3. Junio C HamanoFeb 16, 2023
  4. Patrick SteinhardtFeb 20, 2023
  5. Junio C HamanoFeb 21, 2023
  6. Junio C HamanoFeb 16, 2023
  7. Patrick SteinhardtFeb 20, 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.