[libc-commits] [PATCH] D77949: [libc] Add SIMD strlen implementation .

Mitch Phillips via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Apr 13 16:20:05 PDT 2020


hctim added a comment.

Thanks for the clarification on word boundary - I missed that part of the code.

ASan + HWASan are byte-precise, MSan is bit-precise. You would have to blacklist strlen from being sanitized and write a range check in the sanitizer (like the interceptors currently do).

I don't think relying on UB is a good idea. LLVM libc would immediately become incompatible with anything that has protection granularity less than `sizeof(uintptr_t)`.

> this scheme is technically safe because no mmu that I know of can deal make fault pages on non word boundaries

Sure - it might not seem to break x86 or amd64's MMUs, but we can't make the same guarantee of other RISC implementations or DMA systems. I feel like this would just bury the gremlins for someone to find out about later. I'm fairly sure it also could break Intel SGX (as enclave size can be 1, 2, or 4 bytes).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77949/new/

https://reviews.llvm.org/D77949





More information about the libc-commits mailing list