🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #3361

Re: [PATCH v2 4/4] pack-check: use size_t for the size passed to verify callbacks

#3361
From: Elia Pinto
Date: Thu, 19 Nov 2026 06:05
29 lines
12064 bytes
On Wed, Nov 18, 2026 at 02:34:11PM +0100, Patrick Steinhardt wrote:
> The more interesting question to me is: if they only inspect a prefix,
> do they actually notice that something is off and report the error? If
> not that certainly sounds like a bug to me.

Looking at it again, on master the callback is not even reached for
such an object. Just before calling it, verify_packfile() checks the
object with check_object_signature(), which also takes an "unsigned
long". It hashes only the prefix, the hash does not match, and fsck
reports "packed <oid> from <pack> is corrupt" for an object that is
fine. So fsck does complain, but for the wrong reason, and the commit
message is wrong to say that the callbacks look at a prefix today.

check_object_signature() is changed by 1/4 of "use size_t when parsing
and checking objects" [1]. Only then is the callback reached, and it
needs this patch to get the whole size, plus the rest of [1] for
parse_object_buffer() and fsck_object(). So 4/4 belongs on top of [1],
and I will resend it there with a corrected message.

Blobs are not affected: on these platforms core.bigFileThreshold, an
"unsigned long" itself, is below 4GiB, so every blob that large is
checked with stream_object_signature() and reaches the callback
without its data.

[1] https://lore.kernel.org/git/cover.1793444420.git.gitter.spiros@gmail.com/

Thanks,
Elia
Technical Details
Message-ID: <20261119060524.775205-3-gitter.spiros@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-75778-linux-kernel-git=dewy.ru
References: <cover.1793446357.git.gitter.spiros@gmail.com> <cover.1794984184.git.gitter.spiros@gmail.com> <00939c7f1b144fb9dbbc1745e60f7baa18217742.1794984184.git.gitter.spiros@gmail.com> <av2pUyAwTA7e2eOj@pks.im>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-75778-linux-kernel-git=dewy.ru
From: gitter.spiros@gmail.com (Elia Pinto)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2 4/4] pack-check: use size_t for the size passed to verify callbacks
Date: Thu, 19 Nov 2026 07:05:23 +0100
Organization: Usenet Network
Message-ID: <20261119060524.775205-3-gitter.spiros@gmail.com>
References: <cover.1793446357.git.gitter.spiros@gmail.com> <cover.1794984184.git.gitter.spiros@gmail.com> <00939c7f1b144fb9dbbc1745e60f7baa18217742.1794984184.git.gitter.spiros@gmail.com> <av2pUyAwTA7e2eOj@pks.im>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2802837"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+tBE1sp+jJb6vGQRU+DMmIfsLpY= sha256:sh8+KDpx7IePoV4LcVAMGQ19JIQ6G9FNixGFkUg7zuQ=
	sha1:rgJ137E7csMIjLjUTO1GPWci4+E= sha256:RKITQPv8YmqMioMvoTybA9KGyDsD+/5QniK/olgcEPU=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B690511550C; Thu, 19 Nov 2026 09:05:52 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id C3YsCE4mPL_s;
	Thu, 19 Nov 2026 09:05:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-75778-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 103DF1154B7; Thu, 19 Nov 2026 09:05:41 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 4864B2247C8; Thu, 19 Nov 2026 06:05:33 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795068332;
	b=fNq2eOQaycCOmkvDbh3uZFl7DSwYgI3Xvt74+nM0L2zcysTOv08jKCA9BtURDHKxJCha
	 0ogfthjjODb+iDM5kZap7o1E6w5JnCsh+ig9cJTJYz5EBemLU3oQ/XAiZ9F/reCXTBvd5
	 om4QHShuSF7ki+qPXJVb+gaUGv7UzyO30e9aY8RGr+0gsAR/jWy4NUwI84d/ITTRTELHO
	 kQhOF6bdu+XZvFkdeKi/rMY5N+pJ+7de+0aWVOJuYnkD9x/Id+f1/7m4ltDdsJB/A7OhJ
	 c+Y3IekXbf0SKqDhbAlyLUXp8PqL58QdoHtIGFbFpiMOAzdwtU6HgNpIb0uC1u6kzMA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795068332;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=6py4jIJbFVfAegdoB2z9M14rdEUvTUVrpZgKCRHq14g=;
	b=uxZNpdx/Vz1rjmmicHdagZQPKPIU4F2LP86keRftL12Smg1TOWc7ZuOoPbGWbT1/RW6L
	 EF7CYx5ZTNSMEkR7Rl+NqLHJaoCxPGWIVz7CwALPDDhCEaTy2/2WmuUvy4Q3Or2LYMXm+
	 +NgYukYYv848klUJVmEaDlTzyA/DBO/sMiYjfP0DLukhbTXrNtjXeFmtVOAJvhg43HH1J
	 m8rJkshwYcCDcAqdj01/vl1F/BjvszQNiuzMWRZ0qZOKo5LoXFZMkz/QqtcjhfmgOm7+p
	 GNWxFvTEXzStQa7L0glQcXQRRtXMwP4Mz9qejneVcYefrt8bwq3sK08jcQcQrFxziXQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0ZRqrVtw;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 70DF5606A320;
	Thu, 19 Nov 2026 06:05:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0ZRqrVtw
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.45
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795068331;
	b=iDFYyvZ/i/42WMCiM0rhhvnzpY5pE6GqTyUkDz3B2enerQoUQjx3Ip2x9VWkGCJtMiUk
	 U79oYDD0bFRgjIGi/E81Jc20sjP1jXwmJIU+iRHF7DIdNOWEhTEZWOAjw6RVpJx/Q5fTs
	 Z3xtrThIE4X2bP6UzTyTWOURMSM4+DC2gh+UaO5dlET7Uowsm6EFIFirGHeBzhHLc/mPJ
	 aeRbXXigEE9e87jL6aAvwk47RRkpfWymNRXedgOUAIhvAM8uQnLExSJBUIA592oaIaStx
	 DJEwqYm1T1M69E4PBHeNlo5Vw/H2zTcWQT8yRxxPhjoZ/7CDfXaM8Ju6pMDy9It7lFA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795068331;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=6py4jIJbFVfAegdoB2z9M14rdEUvTUVrpZgKCRHq14g=;
	b=mLpVGdb7L0pr2lenz0aFbz6bepcMr5i6Kcvf15zbhmE51J/0ThR7CpAh9lAcYwm0H+db
	 9FsKy+OWf88mt9WF7s+DQCnCIO/ALFtQMZACTtKE/02Pg7ea6HbbUF3juQ4lH8GM18GKl
	 /UrplYgJA51p1hGKcZe84OrHHfsVSXQ5BxMxaWIzGBo8JsKi2Kaa83IGErfHI1QwNt58I
	 W6vReoPuMZ1IDMe2hgMUifjePa3s87ULxWfVwIj5kwCCxSLFOwOlpIboft+3CoSXbMkd0
	 v61L0bA3dAScw08n1Af6UmbZMJ+si3ZuOTdNn17c25tQmUDCb6qzlEzTSpnbogrhiOw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0ZRqrVtw;
	arc=none smtp.remote-ip=209.85.221.45
X-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48948606A33E
	for <git@vger.kernel.org>; Thu, 19 Nov 2026 06:05:31 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48948606A33E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-491846221ffso1464068f8f.3
        for <git@vger.kernel.org>; Wed, 18 Nov 2026 22:05:31 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795068329; x=1795673129; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=6py4jIJbFVfAegdoB2z9M14rdEUvTUVrpZgKCRHq14g=;
        b=0ZRqrVtwl1Fs9zFo9ufAG5hQTDd2seDekvKfHzutIRXws+dMw/+hdQWUyjL/fCPWQm
         fp2Nn36oGP8P7ukGx6FtadiO9YpG8Mv2lHAxJECfkw7po6uOHrnzSqRXthmkVm8vzLWA
         2nJ6MT2JfYUWp1PlH6YOQNqe4YBSHehGjjvzquK52rSgytJvo8m1/0S2Tdiwvqe219+D
         ZMzF1IEuYTZfixyohMC3P1pSVmpgmUXHtrCIyzaDoFUbPFEAs6zppLdaSpmUyIV7N49H
         z7T+dTbocsDYJp+XU+hfRpq1lztF+TRNkxd33/O6eY0BItZoHw9yCwnfD4AgEkF4NmtW
         OUxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795068329; x=1795673129;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=6py4jIJbFVfAegdoB2z9M14rdEUvTUVrpZgKCRHq14g=;
        b=GsPdbQXo/36Gb1wDGBX3HdzgYl/d9BNKFXgd+FBssv5m/TniYZpQDiUG/JuEya7KcH
         lB8o5gmkatLBUAcLXUSPAKC8mABebRrXj6qQI/PMqtahDvMDUFFYH7ny2m2ZzHDqrTHl
         DROnuInGx0oJBytLoKs9u10yFCNBiNxfikGEKMFnItAvX4uIE4fLrzvqZkxn+Z9F16E0
         ty5JsSLmxntKDOT0YAsrx73qXTsHXhdnJsl19J1o3VY+Sq1d79hHlSl4NxZCM2Rl+xoT
         Xc1BCs1zZMYhEesgApYWYwyiOeKV2OhFswTGiOZeIS/pmQiZoUoH99uAKc+4hGpwZRJS
         4S7g==
X-Gm-Message-State: APuU4Z881gdS6B0eiEFYymYfg1Qlns69ubsIR/lnO/a9ZLPPDE1zqzpE
	Y8OQw/rMt5dHkBqz9RE8s+BVVw7h3wLvnX+gqFESkp9IjnQxOhCg2JSQdWqKcQ==
X-Gm-Gg: AZFdTZfXlzlaeELL3Xzkoifge8HlBEVKIG79qZUT9VzgnLqg6B5+re56Xk7GwHvYsO0
	XoDqXGJeXQTFkLQvHFAE9e/VuwKouLgk8vVByPq+bJlSUOJMqSe6lbc5SdLpQl7GHRtAw8cQC1M
	v6E7IPxzeFbzREDrxjBOWfdJnSWfVz7S23GbxWixn2QiNymTdsKLdZhOWzXNkjLdywAF3M52b5S
	jjf02JjG9fnVP01iy/5VOPMhB39HIhyHmXYaGtjYf9zAWd3TTYzGjvCdui/hWtmLA6aHQ3jkabg
	ceCvF4buMsCkhkSgnIA7SWGyoruWv62rhqHVxIkrMFP7SzfVRHY6nyJnGryGGRMh130m7fuEC3v
	qP23VnkPyk9rnzy7RQ1pHp81NH9QhyU7GkXXwNxoH3Pyn4LEOma+PBfkWyAy7x5ELkMOfRFXgM2
	lWbIPVjCz3p/4bShNm467o5Nzzy+Z69QyfmrEddtNmuRTDPk5MMyJ6tYUMC2dm7XPnSDAYYhu9r
	3AODHtOk+eiWJ3QN6NWV97OgIpi2mvaagDMf+6c6UW5OilwoL0pEezi1JFPsk6qydtiJaZzoPpp
	gseawQJU7b4kdH9Af5Bx2T+dYNbqveTtYoUmnWf69TIKRbMqLtih1viVxr8lcec=
X-Received: by 2002:a05:6000:4812:b0:48f:fcac:a5e2 with SMTP id ffacd0b85a97d-4a63bbc54c2mr9166165f8f.38.1795068329508;
        Wed, 18 Nov 2026 22:05:29 -0800 (PST)
X-Received: from ubuntu26lts1.example.com ([151.31.213.44])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a6570dcdddsm8006902f8f.54.2026.11.18.22.05.28
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 18 Nov 2026 22:05:28 -0800 (PST)
X-Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <av2pUyAwTA7e2eOj@pks.im>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list