From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Elia Pinto" <gitter.spiros@gmail.com>,
"Justin Tobler" <jltobler@gmail.com>,
"Han Xin" <hanxin.hx@alibaba-inc.com>,
"Han Xin" <chiyutianyi@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Patrick Steinhardt" <ps@pks.im>,
"Junio C Hamano" <gitster@pobox.com>,
"Jonathan Tan" <jonathantanmy@fastmail.com>
Subject: [PATCH 0/4] use size_t when receiving and verifying packs
Date: Sat, 31 Oct 2026 12:39:34 +0100 [thread overview]
Message-ID: <cover.1793446357.git.gitter.spiros@gmail.com> (raw)
This series continues the search for truncated sizes, this time focusing
on the side that receives and verifies packs: unpack-objects,
index-pack, and pack verification in git fsck. These components keep
object sizes as "unsigned long", while the underlying pack code already
uses size_t.
Each patch addresses a specific part of the pack pipeline:
- 1/4 unpack-objects: on Windows, it dies when receiving an object of
4GiB or more;
- 2/4 index-pack write_compressed(): on all platforms ("unsigned int"),
--fix-thin with a local base of 4GiB or more dies with "serious
inflate inconsistency", verified by simulating at 16 bits;
- 3/4 index-pack: on Windows, it triggers a false "SHA1 COLLISION
FOUND" when the object already exists locally;
- 4/4 pack-check: on Windows, "git fsck" checks a prefix of objects in
packs.
These are all failures (die) or checks on a prefix; no corrupt data ends
up being written.
No tests are added, for the same reason as the object parsing series
(requiring 4GiB objects and 32-bit long platforms, or objects of 4GiB on
all platforms for 2/4).
This series closes the pack-verification boundary left open for
fsck_object() by the object parsing and checking series:
https://lore.kernel.org/git/cover.1793444420.git.gitter.spiros@gmail.com/
It does not depend on other in-flight series and merges cleanly with
them. For the full effect on non-streamed objects in 1/4, the downstream
fsck_object() / parse_object_buffer() (from the series above) and
odb_write_object() (from v3 of "use size_t for a few more object and
buffer sizes") are needed as well:
https://lore.kernel.org/git/cover.1793439137.git.gitter.spiros@gmail.com/
Pack-objects (delta search below core.bigFileThreshold) is left for a
later series.
Based on master 50fe5cc63f.
Elia Pinto (4):
unpack-objects: use size_t for object sizes
index-pack: use size_t in write_compressed()
index-pack: use size_t for object sizes
pack-check: use size_t for the size passed to verify callbacks
builtin/fsck.c | 2 +-
builtin/index-pack.c | 14 +++++++-------
builtin/unpack-objects.c | 36 +++++++++++++++++-------------------
odb.h | 2 +-
pack.h | 2 +-
5 files changed, 27 insertions(+), 29 deletions(-)
base-commit: 50fe5cc63f9cd6e89b87a2c9ccf96a444f4cfdb7
--
2.53.0
next reply other threads:[~2026-10-31 11:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 11:39 Elia Pinto [this message]
2026-10-31 11:39 ` [PATCH 1/4] unpack-objects: use size_t for object sizes Elia Pinto
2026-10-31 11:39 ` [PATCH 2/4] index-pack: use size_t in write_compressed() Elia Pinto
2026-10-31 11:39 ` [PATCH 3/4] index-pack: use size_t for object sizes Elia Pinto
2026-10-31 11:39 ` [PATCH 4/4] pack-check: use size_t for the size passed to verify callbacks Elia Pinto
2026-11-18 6:56 ` [PATCH v2 0/4] use size_t when receiving and verifying packs Elia Pinto
2026-11-18 6:56 ` [PATCH v2 1/4] unpack-objects: use size_t for object sizes Elia Pinto
2026-11-18 6:56 ` [PATCH v2 2/4] index-pack: use size_t in write_compressed() Elia Pinto
2026-11-18 6:56 ` [PATCH v2 3/4] index-pack: use size_t for object sizes Elia Pinto
2026-11-18 6:56 ` [PATCH v2 4/4] pack-check: use size_t for the size passed to verify callbacks Elia Pinto
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.1793446357.git.gitter.spiros@gmail.com \
--to=gitter.spiros@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=avarab@gmail.com \
--cc=chiyutianyi@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hanxin.hx@alibaba-inc.com \
--cc=jltobler@gmail.com \
--cc=jonathantanmy@fastmail.com \
--cc=ps@pks.im \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.