From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 828921F47C for ; Sun, 22 Jan 2023 07:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjAVHuT (ORCPT ); Sun, 22 Jan 2023 02:50:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjAVHuT (ORCPT ); Sun, 22 Jan 2023 02:50:19 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD9871E9C0 for ; Sat, 21 Jan 2023 23:50:17 -0800 (PST) Received: (qmail 4972 invoked by uid 109); 22 Jan 2023 07:50:17 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 22 Jan 2023 07:50:17 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 27798 invoked by uid 111); 22 Jan 2023 07:50:21 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sun, 22 Jan 2023 02:50:21 -0500 Authentication-Results: peff.net; auth=none Date: Sun, 22 Jan 2023 02:50:16 -0500 From: Jeff King To: =?utf-8?B?UmVuw6k=?= Scharfe Cc: Git List , Junio C Hamano , =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Subject: Re: [PATCH] tree-walk: disallow overflowing modes Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, Jan 21, 2023 at 10:36:09AM +0100, René Scharfe wrote: > When parsing tree entries, reject mode values that don't fit into an > unsigned int. Seems reasonable. I don't think you can cause any interesting mischief here, but it's cheap to check, and finding data problems earlier rather than later is always good. Should it be s/unsigned int/uint16_t/, though? -Peff