Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp815237pxb; Tue, 12 Apr 2022 14:12:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3kOSg5G7TYgeqThtVG6FU19G8w+BCxcTjZtydHRx3ZDrV7tsUWVeZf+GUCPTntNwyuS2v X-Received: by 2002:a17:90a:5291:b0:1ca:b45d:eb3e with SMTP id w17-20020a17090a529100b001cab45deb3emr7093351pjh.207.1649797973787; Tue, 12 Apr 2022 14:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649797973; cv=none; d=google.com; s=arc-20160816; b=dZv4B3ACybW3kJgnDY/M7nhw5H9yM+Mm0p0z5SxpmqD7FCpPG0P/jvHXwKIeWjmwo9 ZgMB4I5I3Y/hH3ERJs4xL/VmPa1iXeXwr+htN6MgfxmmHLOoC8DdbeQox3DJqtoCQ2E3 VoWwmq2Ae7lZtouQwn9w3s0XHDFBhcXv7SdmGCzYKihc7z0VKvKkr1X7THDrK3IQoMWZ Ej88543cbjl8IpNPgOJVA+geOo1/c9IXLhtJSBLSw5XVGDCL1r0vi0R8A1j8oIZnvcDU NNdwFa9BWXMND7zliBclPJOehJWeJOuFR/uQRgVn7/DZWXZa8/70sLoLJ2PoNnG7wXfx 6rWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y/Cr0sW6LvQcjn14eh/sxh0OZHnIHy5g5IjzMbl5Fzw=; b=uEEqVHjv80TEPf/u1Fcb2+bWVG9ZfuzS9SVoEcAr8uYhxS2BzX/2hGgclnjY7bsnOf 7Xa8vlaut8oaLASGVsNQ9PApccAihCoNpbti689cvvnQBzejoe/oiExSauS4/JrMpJwv J3mVuDNEfs6rXlNPboww92lGtZTXbHpWcEWhKbFa4rLU8T/QhJ3QD4q+LqAu/JVe6fME VE6mTFhCSBuqNUbn71v92bQKVjKJRPzOL5zYWEGcrmO4z4aHcR/+jouY/toWUjEMGwwH 46uxJr6WoAUU6U1zrcS6ozDydo81NislYAj1bRBwF81lfh5nOKY/owgKH4KZiel/XMpt oKWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ast7xRsn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c25-20020aa79539000000b00505e5d98912si3672434pfp.296.2022.04.12.14.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 14:12:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ast7xRsn; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0B015E9970; Tue, 12 Apr 2022 13:28:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243325AbiDLHAL (ORCPT + 99 others); Tue, 12 Apr 2022 03:00:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351457AbiDLGxk (ORCPT ); Tue, 12 Apr 2022 02:53:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0485F3FBF5; Mon, 11 Apr 2022 23:41:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B0089B818C8; Tue, 12 Apr 2022 06:40:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDEEDC385A6; Tue, 12 Apr 2022 06:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649745658; bh=DbW/wf8OevNXBSLug74Z5bRsiyjkLn//vz/Chq+D7Mw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ast7xRsnadrgJszdy2DAj0hojVEB2Ua/5UIXtML/Ja9etl78GNkEcDgIORsqisKMO kgz+nDmrISWcHYZJtVSeFbcfVxQTeTe1uv9/6GY9txIpPnI3G0vNMUZmR9RCkhAk66 F251PsbEZwWG76d7HfBK4vl7eyY9GD/jHAeugn1c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Marco Elver , Masahiro Yamada , Michal Marek , Nick Desaulniers , Nathan Chancellor , Andrey Ryabinin , "Peter Zijlstra (Intel)" , Stephen Rothwell , Arnd Bergmann , Andrew Morton , Linus Torvalds , Tadeusz Struk Subject: [PATCH 5.10 160/171] ubsan: remove CONFIG_UBSAN_OBJECT_SIZE Date: Tue, 12 Apr 2022 08:30:51 +0200 Message-Id: <20220412062932.528214929@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412062927.870347203@linuxfoundation.org> References: <20220412062927.870347203@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Kees Cook commit 69d0db01e210e07fe915e5da91b54a867cda040f upstream. The object-size sanitizer is redundant to -Warray-bounds, and inappropriately performs its checks at run-time when all information needed for the evaluation is available at compile-time, making it quite difficult to use: https://bugzilla.kernel.org/show_bug.cgi?id=214861 With -Warray-bounds almost enabled globally, it doesn't make sense to keep this around. Link: https://lkml.kernel.org/r/20211203235346.110809-1-keescook@chromium.org Signed-off-by: Kees Cook Reviewed-by: Marco Elver Cc: Masahiro Yamada Cc: Michal Marek Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Andrey Ryabinin Cc: "Peter Zijlstra (Intel)" Cc: Stephen Rothwell Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Tadeusz Struk Signed-off-by: Greg Kroah-Hartman --- lib/test_ubsan.c | 11 ----------- scripts/Makefile.ubsan | 1 - 2 files changed, 12 deletions(-) --- a/lib/test_ubsan.c +++ b/lib/test_ubsan.c @@ -89,16 +89,6 @@ static void test_ubsan_misaligned_access *ptr = val; } -static void test_ubsan_object_size_mismatch(void) -{ - /* "((aligned(8)))" helps this not into be misaligned for ptr-access. */ - volatile int val __aligned(8) = 4; - volatile long long *ptr, val2; - - ptr = (long long *)&val; - val2 = *ptr; -} - static const test_ubsan_fp test_ubsan_array[] = { test_ubsan_add_overflow, test_ubsan_sub_overflow, @@ -110,7 +100,6 @@ static const test_ubsan_fp test_ubsan_ar test_ubsan_load_invalid_value, //test_ubsan_null_ptr_deref, /* exclude it because there is a crash */ test_ubsan_misaligned_access, - test_ubsan_object_size_mismatch, }; static int __init test_ubsan_init(void) --- a/scripts/Makefile.ubsan +++ b/scripts/Makefile.ubsan @@ -23,7 +23,6 @@ ifdef CONFIG_UBSAN_MISC CFLAGS_UBSAN += $(call cc-option, -fsanitize=integer-divide-by-zero) CFLAGS_UBSAN += $(call cc-option, -fsanitize=unreachable) CFLAGS_UBSAN += $(call cc-option, -fsanitize=signed-integer-overflow) - CFLAGS_UBSAN += $(call cc-option, -fsanitize=object-size) CFLAGS_UBSAN += $(call cc-option, -fsanitize=bool) CFLAGS_UBSAN += $(call cc-option, -fsanitize=enum) endif