From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ABA5EB64DD for ; Tue, 27 Jun 2023 09:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230505AbjF0Jcx (ORCPT ); Tue, 27 Jun 2023 05:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjF0Jcs (ORCPT ); Tue, 27 Jun 2023 05:32:48 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDDF18E; Tue, 27 Jun 2023 02:32:45 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R431e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=chengyou@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Vm5Ljd4_1687858361; Received: from 30.221.99.225(mailfrom:chengyou@linux.alibaba.com fp:SMTPD_---0Vm5Ljd4_1687858361) by smtp.aliyun-inc.com; Tue, 27 Jun 2023 17:32:42 +0800 Message-ID: <9df31281-479a-f77e-a94a-ec3981b380c7@linux.alibaba.com> Date: Tue, 27 Jun 2023 17:32:41 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 From: Cheng Xu Subject: Re: [PATCH 05/26] RDMA/erdma: use array_size To: Julia Lawall Cc: keescook@chromium.org, kernel-janitors@vger.kernel.org, Kai Shen , Jason Gunthorpe , Leon Romanovsky , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230623211457.102544-1-Julia.Lawall@inria.fr> <20230623211457.102544-6-Julia.Lawall@inria.fr> Content-Language: en-US In-Reply-To: <20230623211457.102544-6-Julia.Lawall@inria.fr> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/24/23 5:14 AM, Julia Lawall wrote: > Use array_size to protect against multiplication overflows. > > The changes were done using the following Coccinelle semantic patch: > > // > @@ > expression E1, E2; > constant C1, C2; > identifier alloc = {vmalloc,vzalloc}; > @@ > > ( > alloc(C1 * C2,...) > | > alloc( > - (E1) * (E2) > + array_size(E1, E2) > ,...) > ) > // > > Signed-off-by: Julia Lawall > > --- > drivers/infiniband/hw/erdma/erdma_verbs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Thanks, Acked-by: Cheng Xu