[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200517.123437.2084818619487673025.davem@davemloft.net>
Date: Sun, 17 May 2020 12:34:37 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: zhangshaokun@...ilicon.com
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
jinyuqi@...wei.com, kuznet@....inr.ac.ru, yoshfuji@...ux-ipv6.org,
kuba@...nel.org, jiri@...nulli.us, nivedita@...m.mit.edu,
peterz@...radead.org, edumazet@...gle.com, jiongwang@...wei.com
Subject: Re: [PATCH v2] net: revert "net: get rid of an signed integer
overflow in ip_idents_reserve()"
From: Shaokun Zhang <zhangshaokun@...ilicon.com>
Date: Sat, 16 May 2020 11:46:49 +0800
> From: Yuqi Jin <jinyuqi@...wei.com>
>
> Commit adb03115f459 ("net: get rid of an signed integer overflow in ip_idents_reserve()")
> used atomic_cmpxchg to replace "atomic_add_return" inside the function
> "ip_idents_reserve". The reason was to avoid UBSAN warning.
> However, this change has caused performance degrade and in GCC-8,
> fno-strict-overflow is now mapped to -fwrapv -fwrapv-pointer
> and signed integer overflow is now undefined by default at all
> optimization levels[1]. Moreover, it was a bug in UBSAN vs -fwrapv
> /-fno-strict-overflow, so Let's revert it safely.
>
> [1] https://gcc.gnu.org/gcc-8/changes.html
>
> Suggested-by: Peter Zijlstra <peterz@...radead.org>
> Suggested-by: Eric Dumazet <edumazet@...gle.com>
...
> Signed-off-by: Yuqi Jin <jinyuqi@...wei.com>
> Signed-off-by: Shaokun Zhang <zhangshaokun@...ilicon.com>
Applied, thanks.
Powered by blists - more mailing lists