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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC4C9C678D4 for ; Tue, 7 Mar 2023 19:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233815AbjCGTO2 (ORCPT ); Tue, 7 Mar 2023 14:14:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230490AbjCGTNz (ORCPT ); Tue, 7 Mar 2023 14:13:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70763B5ABA for ; Tue, 7 Mar 2023 10:57:45 -0800 (PST) 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 1C8C6B819D0 for ; Tue, 7 Mar 2023 18:57:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49695C433D2; Tue, 7 Mar 2023 18:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678215462; bh=8Yyj4be9gHQlt8LRZ9ELuMu7UR9mBrLy6r9E1ZJNluU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pK+u2hP/kHS+o1N20pev2QWif6X/0wi1guhKbuY5Xlva1iKngqAo/gy3fdng82P4i lrZtm2JAFvAxiGvZDNfO0g5S6sjXm9nUu+tSuyWXBSNy3dpEB7hqayn5E0U+G3fwHP YjH6sm/1Zc1Wj0VU6bkXKWezGDqQhy8jO3pcv5Uk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Marco Elver , Alexander Potapenko , Andrey Konovalov , Andrey Ryabinin , Dmitry Vyukov , Josh Poimboeuf , Kuan-Ying Lee , "Peter Zijlstra (Intel)" , Vincenzo Frascino , Andrew Morton , Sasha Levin Subject: [PATCH 5.15 270/567] objtool: add UACCESS exceptions for __tsan_volatile_read/write Date: Tue, 7 Mar 2023 18:00:06 +0100 Message-Id: <20230307165917.629642764@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307165905.838066027@linuxfoundation.org> References: <20230307165905.838066027@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit d5d469247264e56960705dc5ae7e1d014861fe40 ] A lot of the tsan helpers are already excempt from the UACCESS warnings, but some more functions were added that need the same thing: kernel/kcsan/core.o: warning: objtool: __tsan_volatile_read16+0x0: call to __tsan_unaligned_read16() with UACCESS enabled kernel/kcsan/core.o: warning: objtool: __tsan_volatile_write16+0x0: call to __tsan_unaligned_write16() with UACCESS enabled vmlinux.o: warning: objtool: __tsan_unaligned_volatile_read16+0x4: call to __tsan_unaligned_read16() with UACCESS enabled vmlinux.o: warning: objtool: __tsan_unaligned_volatile_write16+0x4: call to __tsan_unaligned_write16() with UACCESS enabled As Marco points out, these functions don't even call each other explicitly but instead gcc (but not clang) notices the functions being identical and turns one symbol into a direct branch to the other. Link: https://lkml.kernel.org/r/20230215130058.3836177-4-arnd@kernel.org Fixes: 75d75b7a4d54 ("kcsan: Support distinguishing volatile accesses") Signed-off-by: Arnd Bergmann Acked-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Josh Poimboeuf Cc: Kuan-Ying Lee Cc: Peter Zijlstra (Intel) Cc: Vincenzo Frascino Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- tools/objtool/check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 3ef767284b3f0..2fc0270e3c1f7 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -908,6 +908,8 @@ static const char *uaccess_safe_builtin[] = { "__tsan_atomic64_compare_exchange_val", "__tsan_atomic_thread_fence", "__tsan_atomic_signal_fence", + "__tsan_unaligned_read16", + "__tsan_unaligned_write16", /* KCOV */ "write_comp_data", "check_kcov_mode", -- 2.39.2