git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Subject: [PATCH 0/3] cache-tree: fix segfaults with invalid cache-trees
Date: Tue, 17 Sep 2024 09:13:05 +0200	[thread overview]
Message-ID: <cover.1726556195.git.ps@pks.im> (raw)

Hi,

this small patch series fixes segfaults that can happen when the index
has a corrupted cache-tree extension. This scenario is covered by t4058,
which documented this segfault. I've noitced that this triggers the leak
sanitizer, so I've decided to fix these segfaults now and handle them
gracefully.

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(-)

-- 
2.46.0.551.gc5ee8f2d1c.dirty


             reply	other threads:[~2024-09-17  7:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-17  7:13 Patrick Steinhardt [this message]
2024-09-17  7:13 ` [PATCH 1/3] cache-tree: refactor verification to return error codes Patrick Steinhardt
2024-09-17 17:05   ` Eric Sunshine
2024-09-18  5:11     ` Patrick Steinhardt
2024-09-17  7:13 ` [PATCH 2/3] cache-tree: detect mismatching number of index entries Patrick Steinhardt
2024-09-19  1:35   ` Junio C Hamano
2024-09-24  6:48     ` Patrick Steinhardt
2024-09-24 17:01       ` Junio C Hamano
2024-09-17  7:13 ` [PATCH 3/3] unpack-trees: detect mismatching number of cache-tree/index entries Patrick Steinhardt
2024-10-07  4:38 ` [PATCH v2 0/3] cache-tree: fix segfaults with invalid cache-trees Patrick Steinhardt
2024-10-07  4:38   ` [PATCH v2 1/3] cache-tree: refactor verification to return error codes Patrick Steinhardt
2024-10-07  4:38   ` [PATCH v2 2/3] cache-tree: detect mismatching number of index entries Patrick Steinhardt
2024-10-07  4:38   ` [PATCH v2 3/3] unpack-trees: detect mismatching number of cache-tree/index entries Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1726556195.git.ps@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).