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: <CANn89iKsJieaBwtb1DbxCbdsSYCQfO6MiUb0JDkWdCp7JnL-kw@mail.gmail.com>
Date:   Wed, 16 Jun 2021 15:19:35 +0200
From:   Eric Dumazet <edumazet@...gle.com>
To:     David Laight <David.Laight@...lab.com>
Cc:     Amit Klein <aksecurity@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Willy Tarreau <w@....eu>,
        "David S. Miller" <davem@...emloft.net>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 5.4 175/244] inet: use bigger hash table for IP ID generation

On Wed, Jun 16, 2021 at 12:19 PM David Laight <David.Laight@...lab.com> wrote:
>
> From: Amit Klein
> > Sent: 16 June 2021 10:17
> ...
> > -#define IP_IDENTS_SZ 2048u
> > -
> > +/* Hash tables of size 2048..262144 depending on RAM size.
> > + * Each bucket uses 8 bytes.
> > + */
> > +static u32 ip_idents_mask __read_mostly;
> ...
> > +    /* For modern hosts, this will use 2 MB of memory */
> > +    idents_hash = alloc_large_system_hash("IP idents",
> > +                          sizeof(*ip_idents) + sizeof(*ip_tstamps),
> > +                          0,
> > +                          16, /* one bucket per 64 KB */
> > +                          HASH_ZERO,
> > +                          NULL,
> > +                          &ip_idents_mask,
> > +                          2048,
> > +                          256*1024);
> > +
>
> Can someone explain why this is a good idea for a 'normal' system?
>
> Why should my desktop system 'waste' 2MB of memory on a massive
> hash table that I don't need.

Only if your desktop has a lot of RAM.

Otherwise the table will be smaller (like it was before this patch)

> It might be needed by systems than handle massive numbers
> of concurrent connections - but that isn't 'most systems'.
>
> Surely it would be better to detect when the number of entries
> is comparable to the table size and then resize the table.

Please send a patch, instead of always complaining about what others do.

Security comes first.

Then eventually we can ' optimize' .

>
>         David
>
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ