Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17425200rwd; Tue, 27 Jun 2023 02:53:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ykw39c4B8OiSLHCZWv2FsxA/3optqvYE2xqA5qKcYGhzkQa7EbKVKn48skPsKRT6gmRvG X-Received: by 2002:a17:902:b608:b0:1b3:d27b:32b0 with SMTP id b8-20020a170902b60800b001b3d27b32b0mr9260270pls.7.1687859586862; Tue, 27 Jun 2023 02:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687859586; cv=none; d=google.com; s=arc-20160816; b=NPv+yw/O1z5fAYzd+nDAiK+XZrzgmLZrM3JDr/XYaM8A0PG1R9IEzOqQxDIf6X5AWk BSgt/+/iBjNBfInzdppmiusUqvvxwt7t3u/o6Plk7YfD+0tHWUX5lfgQVGKRXhA7NKBD 6nJJdNkiU7sJzH3MbDsWy2OFR3eG2tA3iVEz+DOhc3p9Q11ao353F5h75LaToUFi5MrU O3o7czWe62RI1N9e5lGCIf5asWHyBn8PqmpjODoP5ainre0BGNXb4/bW19955qLh/CLM ntgKvGqFjQSlubKqOOp222oPtkUfKUgeiQadV5mtmo1lju3vcTxKgWfXV5sBCIJ+w8tS gq8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id; bh=z+++obK5wsPbYaVCfQ7HR6kV820XyMrUEWIjEucKBc4=; fh=aG7UhOOKaCL28jR619aRtKpy7l75/hNykAR5+BPZI8g=; b=NIyOE7O3xarZIQ5U0JvujyKVLyHPbsHxk8XkyoUz8sAY7K9YNMdraNYlz1y8b0r06O Gw3amiNn+tk0TR6nTDpmTLuurzaxbSUEloFRINx/YNQTmL4Fk++aA9iTpf5VqTb6fmeU i5ZdL2qHHbh15hIaNdgQKbuS3gt2PxIXyBZBcRGhARAQq1QG0/O38WP0W0Xyjb1CJVKG oJH2qrSWW4Tb+H+qSU0b2JA26VXY8Wa5m7RujxvixJOSWNd1Nygk0UwOkEgGR8B22rzW bY4z4JNROBX9h25ScI+JBsm2NW5ATP4nsoEVcqt1NUKdrWq3Yv7ExODWLQXk8oyb44WH kuvA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a170902aa8d00b001b80dbd3913si2659518plr.625.2023.06.27.02.52.54; Tue, 27 Jun 2023 02:53:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230460AbjF0Jct (ORCPT + 99 others); Tue, 27 Jun 2023 05:32:49 -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 X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 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