Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp259917rwl; Tue, 11 Apr 2023 18:04:59 -0700 (PDT) X-Google-Smtp-Source: AKy350YSRjrPO52V6Z0tAxGGgQEHpOouOCMewe0o2vnbca3JQa6CWlcwplluw/QyeAcrj5vaDhr0 X-Received: by 2002:aa7:dc04:0:b0:4fc:c644:6149 with SMTP id b4-20020aa7dc04000000b004fcc6446149mr4016509edu.0.1681261498831; Tue, 11 Apr 2023 18:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681261498; cv=none; d=google.com; s=arc-20160816; b=YS2Cl0tC+R8wgYavLFkNFGCSseqWSj+qhlZ7QSPGynwc8DrW3SdcOG0iAtw+XQb06r tfrRZqkVAdUbydGQBzyQuobNi0MheXrOe190M+UwC96XPJ1ZS6xtozgAj9a8xI1UAV5C gy0Q7s8rHlhK81AxZ7XRGbm6Wvvs8MmSbEsx4welpY2yvVtUShHhbcT6sRyxigfuSV6A NPJfCD+zwdZwZZmpuLKkF0YCQiBmHrourAzQNbUek/a3KWBs814qO9r1AitzkFXFX4y6 vw22hToRh63PDweDrJo7b4/vT+su2jEjIl9r9icCHTEIwqsR7KnloLyyzQ1B8KksRYbd PBTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EUfNHvgbMHbCxR7Z5ej0J4OW6YiW5Ee09V0uQZNWLuA=; b=tR3+zlwucKJnbNNCsPSwVsbYsvddA01umeGcZrPRgVK9lwn+hZN22Atmfi6duX+esi wcXkeI/MCkdrNps4Ict40p5Isfzanoo66MSsLT/nJobnUQ6Q7ESZgEEud+LqgvRvVZqq kDTgHhip7i0MSe5mHD/ghXAQbTdusef7B8defgxq2k/XxNTlbd+WqLO5oTIeL0+edLyP HZ4ntxJ/44QFD9g5RMiLzV/lCmhEmVlDAo6jzlYLtXizwpo9Mc+8VIvJUDUIO8cHNWls 6UlxBBPQ+QikrNiGZ2OVroULFHBbDT10blCZn5QTmoMvTRKe3EfQhoi4uxTQ1LUQl2K8 n06Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=yRuWuTRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020aa7cf82000000b0050493f364b9si1789372edx.440.2023.04.11.18.04.34; Tue, 11 Apr 2023 18:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=yRuWuTRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229490AbjDLAMl (ORCPT + 99 others); Tue, 11 Apr 2023 20:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjDLAMk (ORCPT ); Tue, 11 Apr 2023 20:12:40 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C21BF468A for ; Tue, 11 Apr 2023 17:12:36 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id d22-20020a17090a111600b0023d1b009f52so12781928pja.2 for ; Tue, 11 Apr 2023 17:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681258356; x=1683850356; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EUfNHvgbMHbCxR7Z5ej0J4OW6YiW5Ee09V0uQZNWLuA=; b=yRuWuTRhiWx3XwFpc57Ol2M1IPyVrYtxZC3LJYOl+z6YsIP1MVABRg2+I1SYgCvB5r 9ma9A/JibUHa8FeY439yp5Z1o59QK0Jr36B5oqQWOJiPUjdfX83Yl8tuXtbQFh6gLWR8 dwnI3QGeP/PgL/C7Bi7zDPqNmKSIwYahqjJxsklqdeVWzEfsf3VWL64TZmkx+pwkwv7a gY7m98i6jaFqo3atHGNZpP8nwW4Vil4325RnsXUn1l8VDrF2qkisVY/7Id5ooJQIC4gk 6zn380pEKuZ0vlDDYZsLg2fIGhtIJ61YuSVuQnxwtUt/6ag6cQGbY825Ls8Jf7Edy4hD ff9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681258356; x=1683850356; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EUfNHvgbMHbCxR7Z5ej0J4OW6YiW5Ee09V0uQZNWLuA=; b=on11E10fls6cAz3VN7rHcPHoF5i+IAO8haDTXfQ6qQlUrU60Q7uzgcDknxNZOwhVJc oBE0uAt1cul4X8yyzJHwl6boG2to9tclaqcRaTZ28Atb3ij5ilxlayhks3wC45sKihTW eV06BkWKFmJchDDfJ9TTqxz2HWhxEayFqG8U0oKvn/qwQrLqoLsLjaNb5TD+nxNozGks 6u4gmriP1PVBfXfoUZmF/7Nic6HlJcxbYt5ZVBH0MgfTBwrilnc7jzJ+BdyL9niQYJ/d rWvXHpW28mo+3UI+tqtPVrYj8p17MiK1VMXNlMIeymC86F0VYVhtIzcQI/vXM8PV9U8v 4NAg== X-Gm-Message-State: AAQBX9eM/pPzzqp7QFuslE1Dfv0iwj3Iat+/Z57yjhnRNEtsjn+HW6eH l1Drq4kOomAp0DI9v1cv4O5IMynbkZ7E0rdzWC0B9A== X-Received: by 2002:a17:90b:3641:b0:244:987c:a873 with SMTP id nh1-20020a17090b364100b00244987ca873mr4635662pjb.7.1681258355815; Tue, 11 Apr 2023 17:12:35 -0700 (PDT) MIME-Version: 1.0 References: <20230407215406.768464-1-ndesaulniers@google.com> <20230407215824.GA1524475@dev-arch.thelio-3990X> In-Reply-To: <20230407215824.GA1524475@dev-arch.thelio-3990X> From: Fangrui Song Date: Tue, 11 Apr 2023 17:12:24 -0700 Message-ID: Subject: Re: [PATCH] ubsan: remove cc-option test for UBSAN_TRAP To: Nick Desaulniers Cc: Nathan Chancellor , Kees Cook , Masahiro Yamada , linux-hardening@vger.kernel.org, Tom Rix , Josh Poimboeuf , Peter Zijlstra , Miroslav Benes , linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-kbuild@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 7, 2023 at 2:58=E2=80=AFPM Nathan Chancellor wrote: > > On Fri, Apr 07, 2023 at 02:54:06PM -0700, Nick Desaulniers wrote: > > -fsanitize-undefined-trap-on-error has been supported since GCC 5.1 and > > Clang 3.2. The minimum supported version of these according to > > Documentation/process/changes.rst is 5.1 and 11.0.0 respectively. Drop > > this cc-option check. > > > > Signed-off-by: Nick Desaulniers > > Reviewed-by: Nathan Chancellor > > As an aside, we should really consider having some standard format of > comment around cc-option checks so that we can easily remove them when > they become stale... > > > --- > > Masahiro, Kees: get_maintainer.pl leaves much to be desired for this > > file. Can one of you please pick this up? > > > > lib/Kconfig.ubsan | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan > > index fd15230a703b..0e7ad0782399 100644 > > --- a/lib/Kconfig.ubsan > > +++ b/lib/Kconfig.ubsan > > @@ -15,7 +15,6 @@ if UBSAN > > config UBSAN_TRAP > > bool "On Sanitizer warnings, abort the running kernel code" > > depends on !COMPILE_TEST > > - depends on $(cc-option, -fsanitize-undefined-trap-on-error) > > help > > Building kernels with Sanitizer features enabled tends to grow > > the kernel size by around 5%, due to adding all the debugging > > -- > > 2.40.0.577.gac1e443424-goog > > > -fsanitize-undefined-trap-on-error is a legacy option from 2013 when -fcatch-undefined-behavior instead of -fsanitize=3Dundefined enabled UBSan. On the Clang side, http://reviews.llvm.org/D10464 added -fsanitize-trap=3D in June 2015. It's best to use -fsanitize-trap=3Dundefined and avoid uses of -fsanitize-undefined-trap-on-error. --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF