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

[PATCH v2 0/3] cache-tree: fix segfaults with invalid cache-trees

From
Patrick Steinhardt <ps@pks.im>
Date
Oct 7, 2024, 04:38 UTC
Message-ID
<cover.1728275640.git.ps@pks.im>
In-Reply-To
<cover.1726556195.git.ps@pks.im>
Hi,

this is the second version of my patch series that fixes segfaults when the index has a corrupted cache-tree extension.

I completely forgot about this series, and it seems to have slipped the radar, until I rediscovered some of the segfaults while doing the last couple of leak fixes. So I decided to just resend it with Eric's comment addressed, which boils down to a single clarification of one of the commit messages.

Thanks!
Patrick
Patrick Steinhardt (3):
  cache-tree: refactor verification to return error codes
  cache-tree: detect mismatching number of index entries
  unpack-trees: detect mismatching number of cache-tree/index entries
 cache-tree.c               | 102 ++++++++++++++++++++++++++-----------
 cache-tree.h               |   2 +-
 read-cache.c               |   5 +-
 t/t4058-diff-duplicates.sh |  19 ++++---
 unpack-trees.c             |  12 +++--
 5 files changed, 97 insertions(+), 43 deletions(-)
Range-diff against v1:
1:  413faa2b81 ! 1:  df5a2d0dbc cache-tree: refactor verification to return error codes
    @@ Commit message
     
         Refactor the function to instead return error codes. This also ensures
         that the function can be used e.g. by git-fsck(1) without the whole
    -    process dying.
    +    process dying. Furthermore, this refactoring plugs some memory leaks
    +    when returning early by creating a common exit path.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
     
2:  4bdcc43518 = 2:  d63087c53c cache-tree: detect mismatching number of index entries
3:  fbffeeb6f1 = 3:  5e578c1f41 unpack-trees: detect mismatching number of cache-tree/index entries
base-commit: 3969d78396e707c5a900dd5e15c365c54bef0283
-- 
2.47.0.rc0.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 10 of 13 in “cache-tree: fix segfaults with invalid cache-trees”
  1. 0/3 cache-tree: fix segfaults with invalid cache-treesPatrick Steinhardt, Sep 17, 2024
  2. 1/3 cache-tree: refactor verification to return error codesPatrick Steinhardt, Sep 17, 2024
  3. Eric SunshineSep 17, 2024
  4. Patrick SteinhardtSep 18, 2024
  5. 2/3 cache-tree: detect mismatching number of index entriesPatrick Steinhardt, Sep 17, 2024
  6. Junio C HamanoSep 19, 2024
  7. Patrick SteinhardtSep 24, 2024
  8. Junio C HamanoSep 24, 2024
  9. 3/3 unpack-trees: detect mismatching number of cache-tree/index entriesPatrick Steinhardt, Sep 17, 2024
  10. 0/3 cache-tree: fix segfaults with invalid cache-treesPatrick Steinhardt, Oct 7, 2024
  11. 1/3 cache-tree: refactor verification to return error codesPatrick Steinhardt, Oct 7, 2024
  12. 2/3 cache-tree: detect mismatching number of index entriesPatrick Steinhardt, Oct 7, 2024
  13. 3/3 unpack-trees: detect mismatching number of cache-tree/index entriesPatrick Steinhardt, Oct 7, 2024

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.