This is an archive of the discontinued LLVM Phabricator instance.

-fsanitize={function,kcfi}: Switch to xxh3_64bits
AbandonedPublic

Authored by MaskRay on Jul 19 2023, 2:54 PM.

Details

Reviewers
samitolvanen
Summary

Following recent changes switching from xxh64 to xxh32 for better
hashing performance (e.g., D154813). These particular instances likely
have negligible time, but this change moves us toward removing xxHash64.

The type hash for -fsanitize={function,kcfi} will change. This is
totally fine for =function, I assume that this is fine for =kcfi as well
as we cannot sign for compatibility across different Clang versions.

Diff Detail

Event Timeline

MaskRay created this revision.Jul 19 2023, 2:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 2:54 PM
MaskRay requested review of this revision.Jul 19 2023, 2:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 2:54 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Changing the hash function breaks compatibility with the Rust KCFI implementation. I would personally like to avoid changing how KCFI type hashes are computed unless there's a very compelling reason to switch away from xxHash64.

Changing the hash function breaks compatibility with the Rust KCFI implementation. I would personally like to avoid changing how KCFI type hashes are computed unless there's a very compelling reason to switch away from xxHash64.

Thank you for the rapid reply. So this looks unfortunate, I'll change just -fsanitize=function then (the scheme was just changed a few months ago, not even across arelease; though sanitizers don't really commit to cross-version compatibility). Perhaps the only minor downside is that xxHash64 is going to linger forever.

MaskRay abandoned this revision.Jul 19 2023, 3:23 PM