From nobody Sun Apr 23 19:00:42 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q4Hf2278cz46L5P; Sun, 23 Apr 2023 19:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q4Hf21k0Dz3CjM; Sun, 23 Apr 2023 19:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682276442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63zv6fhjSRIOCAhSpFjRXQlL1PlDiO4y4OXn4vSwJmk=; b=mzsKI4T24PiaN+2j/kx2i5f7zcuZ5tbBtYLqV9kddTFAUa1vSivPTXJw2pEIey/EVcKjav p8PcMuoIPbDBhH/CAFDkqWdEmtE8elBD5Wuk4ASZXb8puxSwDigF9j+KDGJgKBZlH6qhjS Msj3otuX9zXP0HwE+EVR4CoyCpBe6H3VUWvZ90lQaPxfsPKcDo3H1Yz/87IwpLnmQ4Jbhf d4kypQr7W2mQtA/7KdA3xOfMfW884w/sh4f/V604QbNpABLgdzOSzqfdxriJqusE/yR86z sOg8tk984zwvq6ZCtRuO/dMGseZHcVkoCY4I1V3LT84X5P77P8I8Fa5SNPFPXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682276442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=63zv6fhjSRIOCAhSpFjRXQlL1PlDiO4y4OXn4vSwJmk=; b=ELvPJ3xUzXjN9H77l5sRE65udijzxL+xA4SIr9RAoC5sFQ37P2oseZE5CsA8MC2rozGxmN IbwDyaMcno2iPj1j0wt+J/xxoBWgUUU9c/0wrt5XRK0QRsvXu+1qBO6V8JYenEDEoWakfM ALAqAt1z183idn/2dKCmf9amOp0sulCNXNK88oI1LiefXw5WG2uCKV+1+Syo2RjlKeioJR F34e2FtPCHiDXm6V2ZTTuM32yT0M8xrluPKrFfxc+1JEsMGLM7IMDphaqMcmrz8xPnSlVi 8E2Tdelti/9k2AwdTan2aWfwmcn8vtCaJT+BxXU+Y1tXp//yIbqexaHdOn16tg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682276442; a=rsa-sha256; cv=none; b=cOXioD51M4drLcL3z9eQvp3ucXBTviOMvg9kG/gS7HMUtW4vRzo8XhzVJs83mX8a/bgAY0 9hnRM3VdXdAIYMlVACc8nDECb1jG9hIItIOkJTZ3otg9nOAadZ3YkGGxXkgqjAbzGfMtFY uh9/e98p2hwTLbwsefyYa7/e6OLukx0ng81mCaPom9O3tcuCmYNeo4c+0FYqwbURy8ISZn Qoo/ywGartz9L9f1xNLK2HsdvLcaqnfNG+4nFZtLIa9TK1WhIfxxZhSX6bAoYUZkYRP9zj v9uCKHCosHvsuxLY5588/jBJvkLNLf8ynaeXgRgJhapdG45NvLL0BSsWMZm7aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q4Hf20hVkzvTj; Sun, 23 Apr 2023 19:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33NJ0gX2037611; Sun, 23 Apr 2023 19:00:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33NJ0gvq037610; Sun, 23 Apr 2023 19:00:42 GMT (envelope-from git) Date: Sun, 23 Apr 2023 19:00:42 GMT Message-Id: <202304231900.33NJ0gvq037610@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 42162fb2fe30 - main - kcsan: add __tsan_mem(cpy|move|set) aliases for clang >= 16 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42162fb2fe30c0881e7e4d2143ddcfee3e1dd752 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=42162fb2fe30c0881e7e4d2143ddcfee3e1dd752 commit 42162fb2fe30c0881e7e4d2143ddcfee3e1dd752 Author: Dimitry Andric AuthorDate: 2023-04-23 18:11:34 +0000 Commit: Dimitry Andric CommitDate: 2023-04-23 18:59:06 +0000 kcsan: add __tsan_mem(cpy|move|set) aliases for clang >= 16 Summary: After https://github.com/llvm/llvm-project/commit/b4257d3bf58c ("[tsan] Replace mem intrinsics with calls to interceptors") intrinsic calls to memcpy, memmove or memset will directly call sanitizer interceptors, e.g. __tsan_memcpy, __tsan_memmove or __tsan_memset. Building GENERIC-KCSAN with clang >= 16 would thus result in link errors similar to: ld: error: undefined symbol: __tsan_memcpy >>> referenced by cam_compat.c:150 (/usr/src/sys/cam/cam_compat.c:150) >>> cam_compat.o:(cam_compat_handle_0x17) >>> referenced by cam_compat.c:151 (/usr/src/sys/cam/cam_compat.c:151) >>> cam_compat.o:(cam_compat_handle_0x17) >>> referenced by cam_compat.c:152 (/usr/src/sys/cam/cam_compat.c:152) >>> cam_compat.o:(cam_compat_handle_0x17) >>> referenced 1692 more times Similar to subr_msan.c, add aliases from the existing kcsan_* versions of these functions to __tsan_* names. Reviewed by: markj MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D39772 --- sys/kern/subr_csan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/subr_csan.c b/sys/kern/subr_csan.c index 8723777ce84b..f79c638b181c 100644 --- a/sys/kern/subr_csan.c +++ b/sys/kern/subr_csan.c @@ -301,6 +301,10 @@ kcsan_memmove(void *dst, const void *src, size_t len) return __builtin_memmove(dst, src, len); } +__strong_reference(kcsan_memcpy, __tsan_memcpy); +__strong_reference(kcsan_memset, __tsan_memset); +__strong_reference(kcsan_memmove, __tsan_memmove); + char * kcsan_strcpy(char *dst, const char *src) {