Page MenuHomeFreeBSD

kcsan: add __tsan_mem(cpy|move|set) aliases for clang >= 16
ClosedPublic

Authored by dim on Apr 23 2023, 6:12 PM.
Tags
None
Referenced Files
F103160645: D39772.id.diff
Thu, Nov 21, 6:08 PM
Unknown Object (File)
Tue, Nov 19, 10:15 PM
Unknown Object (File)
Sun, Nov 17, 11:37 AM
Unknown Object (File)
Mon, Nov 11, 4:57 PM
Unknown Object (File)
Sat, Nov 9, 4:09 PM
Unknown Object (File)
Mon, Nov 4, 2:05 PM
Unknown Object (File)
Fri, Nov 1, 12:48 PM
Unknown Object (File)
Fri, Nov 1, 12:48 PM
Subscribers

Details

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.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable