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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F1E8C54EE9 for ; Thu, 22 Sep 2022 16:00:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 44AD541B3C; Thu, 22 Sep 2022 16:00:33 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 44AD541B3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1663862433; bh=gpEynFctGM5qQhshzOgACiyqYYZDoojBG8y2+3tT0AY=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=aTRrnJcoDpcqT4VwLxGBbZy1cbcCg4cmJJddP0PwMFK5FWMqEjsfpF5zATvMPQOQJ N15P9FpDPkqp1z7VIzfG/J8rnL0rOE9ZP/c919ZGU/wWVX7+BgTUsDsJQBL/IF1epy W3JgdaqV9/+2pTZOrGVMkM20VJXyIyXSBXztrj+0n1OS6B3b5YIIey7130PqBjPXOw wPgBItbHUbU5KHXVgkXLC4v+kFAUQ39prqZl3b9EqZwdT4I5bZG6ZX82WRf6MfM80g 4w5dSqulWmKEuNqHjUB0A7hjLzJ0Zpp66nQLPQZkcebt6dYrbKElnqgpNk9KD2EMkZ HZvyGAf5bLDRA== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 83mEBIvFO_1t; Thu, 22 Sep 2022 16:00:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id BA0B541B47; Thu, 22 Sep 2022 16:00:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BA0B541B47 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 36CDB1BF359 for ; Thu, 22 Sep 2022 16:00:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1E24D82CB7 for ; Thu, 22 Sep 2022 16:00:30 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 1E24D82CB7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lwopuHGTrlqQ for ; Thu, 22 Sep 2022 16:00:29 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7BA82829EE Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7BA82829EE for ; Thu, 22 Sep 2022 16:00:29 +0000 (UTC) Received: by mail-pl1-x62e.google.com with SMTP id w13so9209802plp.1 for ; Thu, 22 Sep 2022 09:00:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=e+3VYhs+DuwH7bu+QHtV1rjWq3mJNnHisCvMMFS3bAw=; b=Wl8yeLUCGBJz57dt+qlRgmc8Fx/3i/IYouR+xRJWe11apDNRocS7m2WEVxYZYrGTV5 FpnVH0vq/3/70iFHuK7DLPAkxKlaJfnyfrbW4DC7LXeIPzEZeqLFxrkUiAHkShZUez/N 9JBlnqB0MdYSHgBbDPfTvUexhXkHiejva9D2JBvSdzvD9OiI5X4yDlhwLnVSVrHSHyes lxwgV3oHdDD3gpPxnuiT/sKO2eEWVDQMX3RyVe9q+igrsTl+K7gJhYiooPxumaVOPt45 A4+6SAUOC4ZDU+riFeQ/Q0fa7VtbaJuqgNl2IyWW51qLffOtZF6Qthg8jlQuAwtFBXkr onQA== X-Gm-Message-State: ACrzQf1d/ujCmtW41WK6mAaLgMrmgO87XOgMQyYx7olXk9MDvxXGTMT4 BKBU97crz08v+SQFJDXmv/EMJw== X-Google-Smtp-Source: AMsMyM6q4mhFYq39gGoVyx6Hnh47y8QFV1PKitfWXVTUQGpGwPy/JbIncPBlq3WqciXD78b9y3HP3A== X-Received: by 2002:a17:90b:164d:b0:202:69b3:1002 with SMTP id il13-20020a17090b164d00b0020269b31002mr4362502pjb.86.1663862428935; Thu, 22 Sep 2022 09:00:28 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id ms3-20020a17090b234300b002005c3d4d4fsm4007085pjb.19.2022.09.22.09.00.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:00:28 -0700 (PDT) Date: Thu, 22 Sep 2022 09:00:26 -0700 From: Kees Cook To: "Ruhl, Michael J" Message-ID: <202209220859.DA21F91EAE@keescook> References: <20220922031013.2150682-1-keescook@chromium.org> <20220922031013.2150682-8-keescook@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=e+3VYhs+DuwH7bu+QHtV1rjWq3mJNnHisCvMMFS3bAw=; b=XxhEWZKeaIg8g+YPuHc57mvNIPPhpigg738nM9wsLJjiUYpKwjJNzBKKGjefZOhAzi 0KqHQ1P/cHiMmQgsO3z2jt2+D0oCcG8Ck+pj5sopXZOTE33QKhSQ8Lb6DWDYvG77ZJIc GQLx6jVnYAJuMY3HV3uGUN51p3PNgpWkx9A1M= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XxhEWZKe Subject: Re: [Intel-wired-lan] [PATCH 07/12] igb: Proactively round up to kmalloc bucket size X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tang , Nick Desaulniers , "llvm@lists.linux.dev" , "dri-devel@lists.freedesktop.org" , "linux-mm@kvack.org" , Eric Dumazet , "linux-hardening@vger.kernel.org" , Sumit Semwal , "dev@openvswitch.org" , "x86@kernel.org" , "intel-wired-lan@lists.osuosl.org" , David Rientjes , Miguel Ojeda , Yonghong Song , Paolo Abeni , "linux-media@vger.kernel.org" , Marco Elver , Josef Bacik , "linaro-mm-sig@lists.linaro.org" , Jakub Kicinski , David Sterba , Andrew Morton , Vlastimil Babka , Alex Elder , Greg Kroah-Hartman , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Christian =?iso-8859-1?Q?K=F6nig?= , Pekka Enberg , Daniel Micay , "netdev@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , Joonsoo Kim , "David S. Miller" , "linux-btrfs@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Sep 22, 2022 at 03:56:54PM +0000, Ruhl, Michael J wrote: > >From: dri-devel On Behalf Of Kees Cook > [...] > >diff --git a/drivers/net/ethernet/intel/igb/igb_main.c > >b/drivers/net/ethernet/intel/igb/igb_main.c > >index 2796e81d2726..4d70ee5b0f79 100644 > >--- a/drivers/net/ethernet/intel/igb/igb_main.c > >+++ b/drivers/net/ethernet/intel/igb/igb_main.c > >@@ -1196,6 +1196,7 @@ static int igb_alloc_q_vector(struct igb_adapter > >*adapter, > > > > ring_count = txr_count + rxr_count; > > size = struct_size(q_vector, ring, ring_count); > >+ size = kmalloc_size_roundup(size); > > why not: > > size = kmalloc_size_roundup(struct_size(q_vector, ring, ring_count)); > > ? Sure! I though it might be more readable split up. I will change it. :) -- Kees Cook _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan