Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2598243rwn; Fri, 16 Sep 2022 12:55:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Iba9seTI+GAHC/BGwPpwGRnO8FKx5Tx7WYZ+pgilZ3ym3Oo3vIypr6JWC63eyqOrbaiat X-Received: by 2002:a17:906:9b8a:b0:780:da07:9df5 with SMTP id dd10-20020a1709069b8a00b00780da079df5mr141425ejc.273.1663358124593; Fri, 16 Sep 2022 12:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663358124; cv=none; d=google.com; s=arc-20160816; b=o6tcITg8bVhtION82eLX95JCZrTscjh+pwC0jXb+JlYQE3LYXJtFz1DZuaOcUZkWu/ wzKKAkms7D2sTh2nBjxCXwuBsRwsINbIFObmOsD1TLYRIYm3jXJ6sfeTMOt3vHVBSxEF GTVtEV+MwFo75PxcDq0TQYAxCu6uNuEPSGVFobI2um7Oc4SoWVZ9QOojXQhWjiwT0ool ETOgfaKtOlDVUg3Qo7XT+EoFFmRZfWK7KPV+SRNa2VQQfxaRocwQ2+aWdiv+yDZDRiHU p9i+BqmXZpRwtlr7ODcmlJXzdtpsA+8u0BWU1h5HcB36ap17q905IKL5eD5uYBahNfv9 fYqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2s7G4dt85LNXXgPE48/aG1c5OYBe2wtKE1oWydqxaR0=; b=JRu9og3UCD9Zhjc6zUt2/r7g233khQzyrlYMn5ll55gqKt9usAZ8s2/ux6NCzgHJT1 Tkanh5bY4Mi4Vg09wfcwqThoH32ztDhsDqQzOvizMzoU1RF4+DdBwFxricwkJRwW/G1j FOdoT3ChoNsFHFpQD7DGjCgfqTwy8fXWi/hYOxaXBbGdcYeRhhOJ4ESxsNojBCplKKoQ zLrqwvecuDVygr3Tr3pARkjGZVjHI+KweGogJj6jASHq+Rh9VZiEOLN7mfeMJSyRbM3r SuMjSbKJ7SAhED+Bj9JmC/HPCW5iFc7ihp2f/uciCUNAGU7uwXuqlDmc7fUGtXATPTWH zI0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bK4Vpr7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p24-20020a056402501800b00452d32c16dasi2565799eda.302.2022.09.16.12.54.59; Fri, 16 Sep 2022 12:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bK4Vpr7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbiIPTcP (ORCPT + 99 others); Fri, 16 Sep 2022 15:32:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbiIPTcM (ORCPT ); Fri, 16 Sep 2022 15:32:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B42B0B18; Fri, 16 Sep 2022 12:32:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8025DB82921; Fri, 16 Sep 2022 19:32:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4D74C433C1; Fri, 16 Sep 2022 19:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663356728; bh=//xoDX9kOXmkp982WJui+uOT9DeSmbvciR+NGZPx6EU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bK4Vpr7ZMnK1HS7eGhhmG9DvDRAwdhutjJR60Pa+S5R85TA3EA/BA7vIqp84S1vVZ t0BcT/iSnmUpJrvRNvxR1axHAsuZJQVkYvPVE2sEMKOaiATvv9ua5bXkP9TdNvJ8VW NE3R3ast7xLOagKx1tDNTrGLeYmxAtIs3DPZvjZn9elABCqhv3nqbna/HJjlUcSepc 7qANe6kK/vWBlH4G4NYM+6yOCAFpD+1wlhBdgAujge58I3HvRQO9Kuz2GGBPx9wx0T Qagk8veUoGrQRPvTleHMgzr4IJWWeUzWfbHvdTsx38yZ91oioZ7hEDMTvwN8uD0xJP /P86z9AmTEIqw== Date: Fri, 16 Sep 2022 20:31:58 +0100 From: Wolfram Sang To: Dan Carpenter Cc: Kees Cook , Peter Rosin , "Gustavo A. R. Silva" , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] i2c: mux: harden i2c_mux_alloc() against integer overflows Message-ID: Mail-Followup-To: Wolfram Sang , Dan Carpenter , Kees Cook , Peter Rosin , "Gustavo A. R. Silva" , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <202209160046.016AC8B4@keescook> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LH3CZH+3vzn5Op2u" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LH3CZH+3vzn5Op2u Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > The new variable makes it more readable, but beyond that, do you see any > > reason not to just directly compose the calls? > >=20 >=20 > You could do that too. >=20 > You pointed this out in your other email but the one thing that people > have to be careful of when assigning struct_size() is that the > "mux_size" variable has to be size_t. >=20 > The math in submit_create() from drivers/gpu/drm/msm/msm_gem_submit.c > is so terribly unreadable. It works but it's so ugly. Unfortunately, > I'm the person who wrote it. I can't parse from that if the patch in question is okay or needs a respin? Could you kindly enlighten me? --LH3CZH+3vzn5Op2u Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmMkzy0ACgkQFA3kzBSg Kbaztw/+N9X2QXwxeCMfK355UzAvNqP0fyKw/53SNJxPqJzaWafNStUjc6C3ADP2 sKfB/I2gjBm+sAso9p1XcIDlV8Cxbdxyt5h+xCWQt1Ybm6XpUIVlapux0gNOX2ER Y2pc5De4V89fuIY6ZjQMvjwAm4mEsRH25zcXhpS0lVhX2JGeaGDGXc9Iv34L0CW3 qDJOUlF78YJcIoTew5EGmz4WmExudT7Z3RwNKFQOmTuHK4Swmux6rwI18ekAbHHf s7Cvlc3EpxMYYFPR4ReFQg8wnsHrVbyQ6TJP8flGZ1XL59/N9xwhvPTPcQIjWVI3 O2s7xef3USuyT0m2o+S5VsN4whdLVn3TkvxI9tLz9hEFoBOs7zPP3C5iTy8g9ds5 dUpk+J4tC+cagZahifx4+SM8fBvGxlo6BxU+qjhZUihxE8d8kQcrp0/xQCL+lT2x 2eEjPSuYuBLvUqJata/ccnw70VTPSgqyPiV0DeboK3trFVM+ZBOiQXcvAT4UGoyE egT1IozpmnunXR8bgLS1al8Bqbz0AzbGg1xB9G0fqg/F/jpixMZh6BVP8qkHTEgK gs8ysFdupJjLS3fIVDuY/2Jyta1QuBrULQpznjeUFld8QjA8Gy9k2XYBu5UgrcOT eVm8alL5rMthCrqpP138W6Mes+shwVZG6Nj7LCHx7n8ALrzdHyQ= =fKpo -----END PGP SIGNATURE----- --LH3CZH+3vzn5Op2u--