libc: Disable ASAN for certain string functions
authorAlex Richardson <arichardson@FreeBSD.org>
Mon, 2 Aug 2021 08:51:34 +0000 (09:51 +0100)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 2 Aug 2021 13:33:24 +0000 (14:33 +0100)
commit8185be3307232d88ddd1b6468f4ddec54a993f54
treed88045a7359036481a9f2db004691a01451287d0
parentf0712132b68b4271e0602b06ee5f282718bfb8c5
libc: Disable ASAN for certain string functions

They deliberately read out-of-bounds values to avoid byte-by-byte
loads and check multiple bytes at once. While this will work on x86,
it is flagged as an out-of-bounds read with ASAN, so we have to
disable instrumentation here. This also causes bounds errors for CHERI,
so in CheriBSD we use implementations that avoid OOB reads.

Differential Revision: https://reviews.freebsd.org/D31045
lib/libc/string/Makefile.inc