From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E12F58821 for ; Fri, 10 Mar 2023 14:55:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2260DC433EF; Fri, 10 Mar 2023 14:55:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460117; bh=LmWFxfga1BlXuQaJH8jJoOjrDtsHXcfds/zNubj7S/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=InODhgzLbQofQ1lhKx9kWXbB0ihihN+ap+bRMU6hRfCLcnZiJXSroGeyK42VFm4ra ykG12rjKbAiytWNS1d0jMUgyMFfEDmvnScn0IjhkhjN/H1DCRiHSFQX5u/Y9d1ctVW 9WdR3NHypGQItgFLAB86JrFq3NVr3xmSYMa4Mn98= 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.10 229/529] objtool: add UACCESS exceptions for __tsan_volatile_read/write Date: Fri, 10 Mar 2023 14:36:12 +0100 Message-Id: <20230310133815.608566166@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ff47aed7ef6fe..5c4190382a51a 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -864,6 +864,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