Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp817399pxb; Thu, 21 Oct 2021 10:02:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6SWfOgbMSwmiH2XKM/jtu5lK9SyM2xjKPZ+Tt236J6xdWJ8VZ5uy1XGsx2tD1PQQafYbY X-Received: by 2002:adf:a38d:: with SMTP id l13mr8638262wrb.103.1634835771074; Thu, 21 Oct 2021 10:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634835771; cv=none; d=google.com; s=arc-20160816; b=DFqmQ3EB+GU0gPjt8VOgRk8z+Ep/BIG/BlqDzXYyHui6G9Jj8cDjebS3UV7C6Rq3XE vE+Wm3jnxxJxTyo2lBTeX6BMX4P+PVyY49PxHyHo/pQKknWIXn1loH8yLxRrfSS2UPZR ylq7z/BCFI+6u5Ud5JRiTMu7bAHINzRAYQ/vrBvurzD8RepmXD9NuRc7DRfqss+8qwGu XbNUR4dQw48uvX0ktbglMDpbS9I8WmWgvtXjQdU88IsIl3IyZnTSPzelAneX3ieFyWzP OCel5bFJMJetr1JvqPYGqNRVmwPzCaob1zcgkpXqX2pqSTfsIrs2O3PwbTW60ww6xACM tJHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5RyUrXEQJgkpkS3LgGmg7QZzk/Xp6vh/AxqTCLe3xyo=; b=hbvrja2MGDr9NUbrYEJHMm3+Dwi0PaZ7CkvRSmWRiLyr9EuQM+pZyEoILUpCWIzGAV +cSoQgRRnS/ZlUlCadJOA1kWx4B6F+ozJt399HQxuj2R+ozRIuY3auXggu8shBq1afzu VJJUD87jlCVOjH7d6yBPlp4o5cJgx2O8qEoQS1+JnsxIAagxOktVIgpum32cSzwBQ36y iWGnPjBi4Z7qt+BsnuKt6rnwB6bt5zCKqZkO106Z9ronUWu3lZJ2jsdDeetKYJJ4XeK8 N4bAwVzagvevgunEKm9lfTPxZHEfrMzbyF1L2LbzH1ZBk2I0T/qVXVSSFlpaOrS5guwZ Q7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KrRrga5C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si7354305edj.547.2021.10.21.10.02.27; Thu, 21 Oct 2021 10:02:51 -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; dkim=pass header.i=@chromium.org header.s=google header.b=KrRrga5C; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231745AbhJURCx (ORCPT + 99 others); Thu, 21 Oct 2021 13:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbhJURCw (ORCPT ); Thu, 21 Oct 2021 13:02:52 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 716FBC061764 for ; Thu, 21 Oct 2021 10:00:36 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id g184so876543pgc.6 for ; Thu, 21 Oct 2021 10:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5RyUrXEQJgkpkS3LgGmg7QZzk/Xp6vh/AxqTCLe3xyo=; b=KrRrga5C/YO2dLe0TvqzGlGSYEQLjNmER7uhbG0b9kkxrtdRmWn1Nr9EZRKoCnCX6I t4NUngrX6gaK3GG/PDiRpl8xDbd2VtNkJLVHb7tdhwFJ+uypWCHF38OcH5/A2L2fMC6I vu+ScOMVCSX4SUjMU26XP9cvq+DRQoarq3J98= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5RyUrXEQJgkpkS3LgGmg7QZzk/Xp6vh/AxqTCLe3xyo=; b=kpVJ3s1NA5ErHlo97n3iQPIdyJVRLNIVEixO9Uwl36fIXJLdpp4HOV22A1yEQ/3Oop GRXn9IPrFJ8cyA14crnAbKgZ9+BfCKlOkciQ0dFlBZ1EyBhSzhTJROLVYjtXVZcXQLdv c0lgfuLO6vuGJ9WcMq2gGUnIxn/1cbzgw6QfjkaaS5qYlFm0qmmgGXdR8bTamm6aFCJm Wxk31TMqSFfV27GRxKkaBqyDddjW3kH76DKwZ/Lhjs4KfsprupY7q5mDMZxY/JBn4bR/ KZWm0AgT+nTnezcqUDUUvvS/dvhEwv2PeDWIIA+He/8uJlPrBAwxaGJNoFBulgT9yAVw 24/g== X-Gm-Message-State: AOAM532ug1kb91z7xvSbd3R/HHdgcHcor3bG55VVtlNjOd1n0pKVASeP yONW7J2OFQ2yx0RASoeywlBLpqwNJY6CNw== X-Received: by 2002:a62:7a8b:0:b0:44d:47e2:99bf with SMTP id v133-20020a627a8b000000b0044d47e299bfmr6821186pfc.64.1634835635924; Thu, 21 Oct 2021 10:00:35 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c12sm6843823pfc.161.2021.10.21.10.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 10:00:35 -0700 (PDT) Date: Thu, 21 Oct 2021 10:00:34 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Jakub Kicinski , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][net-next] netfilter: ebtables: use array_size() helper in copy_{from,to}_user() Message-ID: <202110210958.6626A30@keescook> References: <20210928200647.GA266402@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210928200647.GA266402@embeddedor> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 28, 2021 at 03:06:47PM -0500, Gustavo A. R. Silva wrote: > Use array_size() helper instead of the open-coded version in > copy_{from,to}_user(). These sorts of multiplication factors > need to be wrapped in array_size(). > > Link: https://github.com/KSPP/linux/issues/160 > Signed-off-by: Gustavo A. R. Silva Thanks! Reviewed-by: Kees Cook I see that this is marked "Awaiting Upstream" (for an ebtables maintainer ack?) https://patchwork.kernel.org/project/netdevbpf/patch/20210928200647.GA266402@embeddedor/ -- Kees Cook