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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YMoRNZYXoykO7mk0@kroah.com>
Date:   Wed, 16 Jun 2021 16:56:53 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Amit Klein <aksecurity@...il.com>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Eric Dumazet <edumazet@...gle.com>, 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:16:52PM +0300, Amit Klein wrote:
> Here is the patch (minus headers, description, etc. - I believe these
> can be copied as is from the 5.x patch, but not sure about the
> rules...). It can be applied to 4.14.236. If this is OK, I can move on
> to 4.9 and 4.4.
> 
> 
>  net/ipv4/route.c | 41 ++++++++++++++++++++++++++++-------------
>  1 file changed, 28 insertions(+), 13 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 78d6bc61a1d8..022a2b748da3 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -70,6 +70,7 @@
>  #include <linux/types.h>
>  #include <linux/kernel.h>
>  #include <linux/mm.h>
> +#include <linux/memblock.h>
>  #include <linux/string.h>
>  #include <linux/socket.h>
>  #include <linux/sockios.h>
> @@ -485,8 +486,10 @@ static void ipv4_confirm_neigh(const struct
> dst_entry *dst, const void *daddr)
>      __ipv4_confirm_neigh(dev, *(__force u32 *)pkey);
>  }
> 
> -#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;
>  static atomic_t *ip_idents __read_mostly;
>  static u32 *ip_tstamps __read_mostly;
> 
> @@ -496,12 +499,16 @@ static u32 *ip_tstamps __read_mostly;
>   */
>  u32 ip_idents_reserve(u32 hash, int segs)
>  {
> -    u32 *p_tstamp = ip_tstamps + hash % IP_IDENTS_SZ;
> -    atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
> -    u32 old = ACCESS_ONCE(*p_tstamp);
> -    u32 now = (u32)jiffies;
> +    u32 bucket, old, now = (u32)jiffies;
> +    atomic_t *p_id;
> +    u32 *p_tstamp;

Your patch is corrupted and couldn't be applied if I wanted to :(

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ