Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20879875rwd; Thu, 29 Jun 2023 08:08:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DnQzJs/+bxVzaQFs/J818DNeJtjejLgSDtJPD78jHO5Jr8sPU7MgmyhdGtg0unQcJbw43 X-Received: by 2002:a05:6a20:1455:b0:111:2f20:d48f with SMTP id a21-20020a056a20145500b001112f20d48fmr33030830pzi.53.1688051281076; Thu, 29 Jun 2023 08:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688051281; cv=none; d=google.com; s=arc-20160816; b=JGh/13Dh/11uMO6qV3vwPVUi94J/61q/FPQraTOrecNysKg9oh29SNGsxu4gBsCu73 HKmJDdLRCYwK4OM7o2VGA/vXpTXNrVcbGemvo26RkuQTK5H2HCm1K24azMdLiR8yTosj VxawOcvFTmS2e+CoEOTSL2ptIngMFmdbbQ02ylfE2hJaR20hrQWo76fDrCyZu5T+SWLh MAjX2TcFgDUyxt5wYJwKNca/TcYw14j51T1cqUKjW3+HorR5o075yYxIOpadgwzba/ui rtzNOJ03eVpWGn0dG/YcNORX2XHgIsfRnloA9Z3Dg5NG9pKmDA30Xpn+mhW3uBwbJ1Hg i0fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=04nmGvUSzed+RPQKn6uXEdcAH6zz7Jtopau6rGJZL1k=; fh=pK6zLQIBcR6K6j4wBmUazE0+nxwC+OU9arzVb2/Z3qg=; b=0SxnvpPjYAuvkdpcM7irGcxKE/GZALojSs1biM49cxHmb4zSKX2D1hrEUcxcedISqt /afyH69B+AM3vZE2lTfBcqtSAjHxDW0Nlltn6b3bnEITbcDd3n52KnBOLZDIyeTi+fbL uGkLvpC7VXsw+fWTvZajmrmNBmCWjMmEYqKJCbhzveDDsELhYsKeKpAXFNhJSFUjIMNt 5+jO2WRiNJ3eRSkK39bXaOiZU7ps3PLifDSXRTXdXeBjxbp824OLpsWxH6HpZ/BdZsMS M2SC+meUvvVybwpAoX0F0/9lPLUxDCEU50tn0OpQ0CCaKxEEB40dAZLXINYVpxNqTL75 G4XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Iq6dIclc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=gEATPY1w; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f25-20020a631019000000b0055382f1e985si10707062pgl.333.2023.06.29.08.07.39; Thu, 29 Jun 2023 08:08:01 -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=@suse.cz header.s=susede2_rsa header.b=Iq6dIclc; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=gEATPY1w; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231794AbjF2Ogl (ORCPT + 99 others); Thu, 29 Jun 2023 10:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232421AbjF2Ogg (ORCPT ); Thu, 29 Jun 2023 10:36:36 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B5D535A9; Thu, 29 Jun 2023 07:36:35 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DC22D2185F; Thu, 29 Jun 2023 14:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1688049393; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=04nmGvUSzed+RPQKn6uXEdcAH6zz7Jtopau6rGJZL1k=; b=Iq6dIclc7ejdPofm+LEOQzVdIwCxpSRlwc75ebbbiEtfMfPFYjXaXpXU/vDZO1se8KnBqy bpUJgRrBMXGnIsUzM5vMR6BYlownsDLgNmtNLnQCK8oTQwrK0BGvkLVdSN+7NiSC2lohLG GdbDXbUmIsRw0WJ+yST7BNMK6KDD/AY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1688049393; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=04nmGvUSzed+RPQKn6uXEdcAH6zz7Jtopau6rGJZL1k=; b=gEATPY1wmD/1EbHlFSEY21Xl/mFaUerI5BNNhVmAgYvyKyGEIpDS37PDQiLyxX/9X0BuZH 7LpdDHTWZcRU6kAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A01A113905; Thu, 29 Jun 2023 14:36:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Q3ZQJvGWnWSQHAAAMHmgww (envelope-from ); Thu, 29 Jun 2023 14:36:33 +0000 Date: Thu, 29 Jun 2023 16:30:05 +0200 From: David Sterba To: Julia Lawall Cc: Chris Mason , keescook@chromium.org, kernel-janitors@vger.kernel.org, Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/26] btrfs: zoned: use array_size Message-ID: <20230629143005.GJ16168@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20230623211457.102544-1-Julia.Lawall@inria.fr> <20230623211457.102544-13-Julia.Lawall@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230623211457.102544-13-Julia.Lawall@inria.fr> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 23, 2023 at 11:14:43PM +0200, 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 = {vmalloc,vzalloc,kvmalloc,kvzalloc}; > @@ > > ( > alloc( > - (e1) * (e2) > + array_size(e1, e2) > ,...) > | > alloc( > - (e1) * (COUNT) > + array_size(COUNT, e1) > ,...) > ) > // > > Signed-off-by: Julia Lawall Added to misc-next with updated subject and changelog, thanks.