This is an archive of the discontinued LLVM Phabricator instance.

asan: fix kernel callback naming in instrumentation module
ClosedPublic

Authored by andreyknvl on Jan 23 2018, 7:32 AM.

Details

Summary

Right now clang uses "_n" suffix for some user space callbacks and "N" for the matching kernel ones. There's no need for this and it actually breaks kernel build with inline instrumentation. Use the same callback names for user space and the kernel (and also make them consistent with the names GCC uses).

Diff Detail

Repository
rL LLVM

Event Timeline

andreyknvl created this revision.Jan 23 2018, 7:32 AM

Please fix hwasan as well.

Please fix hwasan as well.

AFAICS hwasan always uses the same suffix. You want me to make it use "_n" instead of "N"?

Yes, the same as asan.

Asan uses "asan_loadN" and "asan_storeN" and hwasan now has "hwasan_loadN" and "hwasan_storeN", so both use "N" and this is consistent as is.

Asan however has "__asan_report_store_n_noabort" (and others based on "kAsanReportErrorTemplate"), which uses "_n", but hwasan doesn't have those as of yet.

Ah, ok. It's strange to have different suffixes for error vs access callbacks. Is that for GCC compatibility?

It is strange indeed.

GCC does the same, but I'm not sure who started doing it first.

eugenis accepted this revision.Jan 23 2018, 10:59 AM
This revision is now accepted and ready to land.Jan 23 2018, 10:59 AM

Could you commit this?

This revision was automatically updated to reflect the committed changes.