[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160922.024254.1880139496617528792.davem@davemloft.net>
Date: Thu, 22 Sep 2016 02:42:54 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: jiri@...nulli.us, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: get rid of an signed integer overflow in
ip_idents_reserve()
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Tue, 20 Sep 2016 18:06:17 -0700
> From: Eric Dumazet <edumazet@...gle.com>
>
> Jiri Pirko reported an UBSAN warning happening in ip_idents_reserve()
>
> [] UBSAN: Undefined behaviour in ./arch/x86/include/asm/atomic.h:156:11
> [] signed integer overflow:
> [] -2117905507 + -695755206 cannot be represented in type 'int'
>
> Since we do not have uatomic_add_return() yet, use atomic_cmpxchg()
> so that the arithmetics can be done using unsigned int.
>
> Fixes: 04ca6973f7c1 ("ip: make IP identifiers less predictable")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-by: Jiri Pirko <jiri@...nulli.us>
> ---
> David, Jiri, I removed the prandom_u32() stuff in favor of a traditional
> loop to meet stable requirements. Thanks !
Applied.
Powered by blists - more mailing lists