Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp13049941rwd; Fri, 23 Jun 2023 15:01:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6CxMqspXuPQQt5uaS9FG4ug9ozeUhN/BQNdkmACSe1lbuvow67ZuHUVuLypvwcbn8GCGaR X-Received: by 2002:a05:6a20:6a22:b0:122:b613:8b2 with SMTP id p34-20020a056a206a2200b00122b61308b2mr12865681pzk.0.1687557677461; Fri, 23 Jun 2023 15:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687557677; cv=none; d=google.com; s=arc-20160816; b=k7gd8Mjg15lZm9EELs3G6xVSdFjEKkRSBr0Pmrtdvt5AvzA1uyCTyQwljsoSR8hQxW eImI0gVyIc0UVcAp/nyvN6WwnGBYhiIJ+3W9X6NrjQ4b3dFC3SIRqKprwcV6WaNLaywG a3VajtDFelapClb9zeL6x/jsFcwr02AnRXgEkaNMSwOCvylcxJLHtZ0p5/Id7qTcxoxc lNoLeShOurmCaaEq3egEkcjt13tvjwYy8B8EU7JEpwLIJ83AY4kiVJF0N4eZSQxL2khD /SEhe7mbaszH9UC7/uT5BhTQfiOL+zJRZZuQ5s3+bCoIPnD6c90Mqo+l4Mwv6BZc3Bws 2ksw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vKykNlOx+IYCcda+j3r4HjOXr8RTAPOM9+ozRi0gyU0=; fh=kRfyVDrW79GNi9ykuief/gDb/KUIP+KR0khLG72Q3Yk=; b=IqUbIMIrkv3eaqZncs/ZP/gdyWHkWKDcUXR4eO8Bk9FFoW3OEZuxTxppqt+f51eC5t 7DL+t61r7ismnniIsW4NxAXmL7+GSz5oe4Px3kMfsi88G+v/crtgCU0fQPUBZNnN1U9C /E6AEeBangqu5QRfHLlSXil5aWv7O5IPXl3q9DjidsbBVSzZcYNAiu9z7e6+QgwlzQ8s 7LOv8+CFWAD2eu7/wNi0/JrNR2u2enBD5gO/j1lEPMnGQP9reyRUzF7SsX53ZmOGe05H v5x5F3oR43RI7WZz6erAuOVh4rAwGXMepRsC1l/FcbTPJrxvW7T9uFezkkdzYEN2lEUX t3xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=qVR3YSLE; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a170902e9c400b001b1a240b107si110499plk.221.2023.06.23.15.01.03; Fri, 23 Jun 2023 15:01:17 -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=@google.com header.s=20221208 header.b=qVR3YSLE; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232343AbjFWVn0 (ORCPT + 99 others); Fri, 23 Jun 2023 17:43:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbjFWVnK (ORCPT ); Fri, 23 Jun 2023 17:43:10 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8172100 for ; Fri, 23 Jun 2023 14:43:08 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4007b5bafceso32311cf.1 for ; Fri, 23 Jun 2023 14:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687556588; x=1690148588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vKykNlOx+IYCcda+j3r4HjOXr8RTAPOM9+ozRi0gyU0=; b=qVR3YSLErh6dr+Vb1AW2l4ftjP/Z4eSmPCPM8Q59yk5s5BsNMzyRfXXJ2NxCrWiI0X dkPzCwqi3u1pdFXEfF5X6E7coC3rsdV7oICfd5bVHy4boenulW8oUI36No+kaGwjU9Xh 4RbGRaFQ2QK4v3/i94/gpuKoxtTlmHg4ZwhKv97u3B9yDaMNrZjCd0QT0zSwGbqQuC0n j97VDTVMiy7HkTiYD+rv2kX5T26rP2XDMUm+eSgPhRlZt4IH7Xe0Q76v2Iad4cuy5qgq r1dEP8HPBig2LfrXd0mtktYQ27ko7xu3GzeZD30ESsSG8o09OFq/JZ0WTABrUfj9oDmE rloA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687556588; x=1690148588; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vKykNlOx+IYCcda+j3r4HjOXr8RTAPOM9+ozRi0gyU0=; b=XoDcaFhynG7BBm0zb+8iwxIhr5xjJMJOZfuv3UmqzuV530fEKy4idxBSRvhgB1AfvF RbjGkUhcPRbdDzkL3oTFu6eD2EgtkGiMC54QZkwDYeryYUT/005vmZi/AzgopBYEj4Uj hLmaeNO+spT4liv2Fv/TUstkB3mBQLXylOtRMpEPvN9kr4wnHW44R4XkzulMVN6sLKH2 QhAQclWy1xnBQg0GJEZyCJgcWhXHjJ7D7DtabDSZixKVF08X6kxlTtx9UuSohZDeGndR tljWnzZn9loz8h2FrBzutdq0tAenoCKPQHO4L9QQZeuKflSdpFYzfAhMBCh8osRLBtJH zPQw== X-Gm-Message-State: AC+VfDx9Vd3FbFJOMfnz+YZ1bDpuiaU2EwRXDI5sIh0vQas1hFTG4jIf zlWYAw3eRiw2xXVP914vgI1fsBoCJhsq9FyJBE0O X-Received: by 2002:a05:622a:353:b0:3f8:5b2:aef5 with SMTP id r19-20020a05622a035300b003f805b2aef5mr15887qtw.29.1687556587861; Fri, 23 Jun 2023 14:43:07 -0700 (PDT) MIME-Version: 1.0 References: <20230623211457.102544-1-Julia.Lawall@inria.fr> <20230623211457.102544-7-Julia.Lawall@inria.fr> In-Reply-To: <20230623211457.102544-7-Julia.Lawall@inria.fr> From: John Stultz Date: Fri, 23 Jun 2023 14:42:57 -0700 Message-ID: Subject: Re: [PATCH 06/26] dma-buf: system_heap: use array_size To: Julia Lawall Cc: Sumit Semwal , keescook@chromium.org, kernel-janitors@vger.kernel.org, Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , =?UTF-8?Q?Christian_K=C3=B6nig?= , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, "T.J. Mercier" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Fri, Jun 23, 2023 at 2:15=E2=80=AFPM Julia Lawall wrote: > > Use array_size to protect against multiplication overflows. > > The changes were done using the following Coccinelle semantic patch: > > // > @@ > size_t e1,e2; > expression COUNT; > identifier alloc =3D {vmalloc,vzalloc,kvmalloc,kvzalloc}; > @@ > > ( > alloc( > - (e1) * (e2) > + array_size(e1, e2) > ,...) > | > alloc( > - (e1) * (COUNT) > + array_size(COUNT, e1) > ,...) > ) > // > > Signed-off-by: Julia Lawall Thanks for sending this out! Acked-by: John Stultz