lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202209220859.DA21F91EAE@keescook>
Date:   Thu, 22 Sep 2022 09:00:26 -0700
From:   Kees Cook <keescook@...omium.org>
To:     "Ruhl, Michael J" <michael.j.ruhl@...el.com>
Cc:     Vlastimil Babka <vbabka@...e.cz>,
        "linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>,
        Feng Tang <feng.tang@...el.com>,
        "llvm@...ts.linux.dev" <llvm@...ts.linux.dev>,
        "dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Eric Dumazet <edumazet@...gle.com>,
        "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
        "linux-hardening@...r.kernel.org" <linux-hardening@...r.kernel.org>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        "dev@...nvswitch.org" <dev@...nvswitch.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
        "intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
        David Rientjes <rientjes@...gle.com>,
        Miguel Ojeda <ojeda@...nel.org>, Yonghong Song <yhs@...com>,
        Paolo Abeni <pabeni@...hat.com>,
        "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        Marco Elver <elver@...gle.com>,
        Josef Bacik <josef@...icpanda.com>,
        "linaro-mm-sig@...ts.linaro.org" <linaro-mm-sig@...ts.linaro.org>,
        Jakub Kicinski <kuba@...nel.org>,
        David Sterba <dsterba@...e.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Alex Elder <elder@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Pekka Enberg <penberg@...nel.org>,
        Daniel Micay <danielmicay@...il.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Christian König <christian.koenig@....com>,
        "linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>
Subject: Re: [PATCH 07/12] igb: Proactively round up to kmalloc bucket size

On Thu, Sep 22, 2022 at 03:56:54PM +0000, Ruhl, Michael J wrote:
> >From: dri-devel <dri-devel-bounces@...ts.freedesktop.org> 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

Powered by blists - more mailing lists