From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-5.2 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 8215A1F8C6 for ; Mon, 13 Sep 2021 11:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238137AbhIMLoH (ORCPT ); Mon, 13 Sep 2021 07:44:07 -0400 Received: from smtp.hosts.co.uk ([85.233.160.19]:38120 "EHLO smtp.hosts.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234635AbhIMLoH (ORCPT ); Mon, 13 Sep 2021 07:44:07 -0400 Received: from host-84-13-154-214.opaltelecom.net ([84.13.154.214] helo=[192.168.1.37]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1mPkMM-000BsT-4J; Mon, 13 Sep 2021 12:42:50 +0100 Subject: Re: [PATCH] strvec: use size_t to store nr and alloc To: Jeff King Cc: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, Junio C Hamano , Derrick Stolee References: <87o88z82pc.fsf@evledraar.gmail.com> <5e5e7fd9-83d7-87f7-b1ef-1292912b6c00@iee.email> From: Philip Oakley Message-ID: Date: Mon, 13 Sep 2021 12:42:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-GB Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 12/09/2021 23:00, Jeff King wrote: > On Sat, Sep 11, 2021 at 11:48:38PM +0100, Philip Oakley wrote: > >> I'm particularly interested in the int -> size_t change problem as part >> of the wider 4GB limitations for the LLP64 systems [0] such as the >> RaspPi, git-lfs (on windows [1]), and Git-for-Windows[2]. It is a big >> problem. > Note that a lot of the Windows LLP64 problems are really a separate > issue. They come from a misuse of "unsigned long" as "gee, this should > be big enough for anything". Most of that is due to its use for object > sizes, which of course infected a whole bunch of other code. I don't see it (root cause) as independent though. This is a nicely separated issue (effect), which helps. > Which isn't to say it's not important. But my main goal here was making > sure we use size_t for growth allocations to avoid integer overflow > leading to under-allocation (and thus heap overflow). It's also been helpful in highlighting some of the wider issues and approaches. Thank you Philip