netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: jiri@resnulli.us, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: get rid of an signed integer overflow in ip_idents_reserve()
Date: Thu, 22 Sep 2016 02:42:54 -0400 (EDT)	[thread overview]
Message-ID: <20160922.024254.1880139496617528792.davem@davemloft.net> (raw)
In-Reply-To: <1474419977.23058.53.camel@edumazet-glaptop3.roam.corp.google.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Tue, 20 Sep 2016 18:06:17 -0700

> From: Eric Dumazet <edumazet@google.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@google.com>
> Reported-by: Jiri Pirko <jiri@resnulli.us>
> ---
> David, Jiri, I removed the prandom_u32() stuff in favor of a traditional
> loop to meet stable requirements. Thanks !

Applied.

      reply	other threads:[~2016-09-22  6:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 12:00 UBSAN reports issue in ip_idents_reserve Jiri Pirko
2016-09-20 13:28 ` Eric Dumazet
2016-09-20 13:36   ` David Laight
2016-09-20 13:45     ` Eric Dumazet
2016-09-20 13:39   ` Jiri Pirko
2016-09-20 14:11     ` Eric Dumazet
2016-09-20 14:18       ` Eric Dumazet
2016-09-20 14:24         ` Eric Dumazet
2016-09-20 17:46         ` Jiri Pirko
2016-09-20 18:42           ` Eric Dumazet
2016-09-20 15:25       ` Eric Dumazet
2016-09-20 16:25         ` Jiri Pirko
2016-09-21  1:06   ` [PATCH net] net: get rid of an signed integer overflow in ip_idents_reserve() Eric Dumazet
2016-09-22  6:42     ` David Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922.024254.1880139496617528792.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).