From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A24AC433DF for ; Sun, 17 May 2020 19:34:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68B15206F4 for ; Sun, 17 May 2020 19:34:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726552AbgEQTej (ORCPT ); Sun, 17 May 2020 15:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbgEQTej (ORCPT ); Sun, 17 May 2020 15:34:39 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4827CC061A0C; Sun, 17 May 2020 12:34:39 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id EBAB8128A077E; Sun, 17 May 2020 12:34:37 -0700 (PDT) Date: Sun, 17 May 2020 12:34:37 -0700 (PDT) Message-Id: <20200517.123437.2084818619487673025.davem@davemloft.net> To: zhangshaokun@hisilicon.com Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, jinyuqi@huawei.com, kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, kuba@kernel.org, jiri@resnulli.us, nivedita@alum.mit.edu, peterz@infradead.org, edumazet@google.com, jiongwang@huawei.com Subject: Re: [PATCH v2] net: revert "net: get rid of an signed integer overflow in ip_idents_reserve()" From: David Miller In-Reply-To: <1589600809-18001-1-git-send-email-zhangshaokun@hisilicon.com> References: <1589600809-18001-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 17 May 2020 12:34:38 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shaokun Zhang Date: Sat, 16 May 2020 11:46:49 +0800 > From: Yuqi Jin > > 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 > Suggested-by: Eric Dumazet ... > Signed-off-by: Yuqi Jin > Signed-off-by: Shaokun Zhang Applied, thanks.