Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2044776pxb; Mon, 13 Sep 2021 10:42:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq+YZ0SUrTlyxai2YHpRg55ArZSLMJQnSRcPc8O51bBQh/5eGwBLgHdHMtili3siKASuhu X-Received: by 2002:a17:906:6c8f:: with SMTP id s15mr14017250ejr.52.1631554949124; Mon, 13 Sep 2021 10:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631554949; cv=none; d=google.com; s=arc-20160816; b=z5109DTwWJEECUw4u3xki/SVx9+aWURf6naWhfgAHZPfhnv+BiESPjyytJl1FFO8dg 1VBYPknBk1O8nftdUqOxn1bIsvEW5B14vfrcRydxQHQjZAlukd/hJoLu5m8ch33y+x49 mILklkFzCkp7dm7fWsiLaXa6NXZmBjRKrWVwYKsrTgsQiOXYNz0Mj0emNy3iovJZ02jL quy1yFUy00i2h5GxAjZW6ZQIDlsV6nc+j6KCZMv/jk9uUwkoZrLZBSpDffIGoK3muF5J 8XPIiRepiKOSHtcDS9KySBnx/AX2eE9/zQWV5oSVgkFXahgqn3UvFf2Ie+CTZzxNICAa jbAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=8qCyg4s0fkyHeN33tEIGDyxtH2yFc8zU7KxFBqdXHXg=; b=flumU8sr++uDYGdyvP2ntQc7OtSLX2+o/kxNo6dVIpNrYrgsGaGS82vlI8Bv1SLNX1 gu6NjK2vavm2b1nT6POFFyZTk1yHy7rWgZ+tfAZC8cuJAp+1YhJtVKqGl/pEnNMzHtUV t/KivabqWyFjslh0Ryq+t2XOr+tTchxtMKnONyTKh25zerWRCFJJ3sNK7sjFpSIM07Da tswXsx70ku8kV3/MQ4C/Y/tA30p/ZPOQETEtPukN5/gQvGtzOLcFPvu0m9QAUYS1jj6o d2vtcuzOynqEvp9yCS/MjBlgf1l/0U6vfMDH0TeX1XJhL7cfoXaFyIjvc+JKNMkVtp8b h97A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si7563928ejd.768.2021.09.13.10.42.00; Mon, 13 Sep 2021 10:42:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345925AbhIMRlM (ORCPT + 99 others); Mon, 13 Sep 2021 13:41:12 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:59631 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346251AbhIMRlE (ORCPT ); Mon, 13 Sep 2021 13:41:04 -0400 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B1470100008; Mon, 13 Sep 2021 17:39:46 +0000 (UTC) From: Alexandre Belloni To: Len Baker Cc: Alexandre Belloni , linux-kernel@vger.kernel.org, Kees Cook , linux-i3c@lists.infradead.org, linux-hardening@vger.kernel.org, Nicolas Pitre , Boris Brezillon Subject: Re: [PATCH] i3c/master/mipi-i3c-hci: Prefer kcalloc over open coded arithmetic Date: Mon, 13 Sep 2021 19:39:44 +0200 Message-Id: <163155475974.409020.13481298120131222771.b4-ty@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210912155135.7541-1-len.baker@gmx.com> References: <20210912155135.7541-1-len.baker@gmx.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Sep 2021 17:51:35 +0200, Len Baker wrote: > As noted in the "Deprecated Interfaces, Language Features, Attributes, > and Conventions" documentation [1], size calculations (especially > multiplication) should not be performed in memory allocator (or similar) > function arguments due to the risk of them overflowing. This could lead > to values wrapping around and a smaller allocation being made than the > caller was expecting. Using those allocations could lead to linear > overflows of heap memory and other misbehaviors. > > [...] Applied, thanks! [1/1] i3c/master/mipi-i3c-hci: Prefer kcalloc over open coded arithmetic commit: 41a0430dd5ca65afdecf10fb0b8b56966a1c5d04 Best regards, -- Alexandre Belloni