This is an archive of the discontinued LLVM Phabricator instance.

hwasan: add -hwasan-match-all-tag flag
ClosedPublic

Authored by andreyknvl on Mar 23 2018, 6:49 AM.

Details

Summary

Sometimes instead of storing addresses as is, the kernel stores the address of a page and an offset within that page, and then computes the actual address when it needs to make an access. Because of this the pointer tag gets lost (gets set to 0xff). The solution is to ignore all accesses tagged with 0xff.

This patch adds a -hwasan-match-all-tag flag to hwasan, which allows to ignore accesses through pointers with a particular pointer tag value for validity.

Diff Detail

Repository
rL LLVM

Event Timeline

andreyknvl created this revision.Mar 23 2018, 6:49 AM

Please add a separate flag, something like -hwasan-match-all-tag= (0 .. 0xFF, -1).

When uploading a change, it is useful to include more diff context. See https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface, or simply use arc.

What do you mean by "(0 .. 0xFF, -1)"? Should it accept a list of tag values in some format?

I meant an integer flag with -1 as default value (for no match-all tag).

andreyknvl retitled this revision from hwasan: kernel: make accesses with pointer tag 0xff unchecked to hwasan: add -hwasan-match-all-tag flag.
andreyknvl edited the summary of this revision. (Show Details)

Done, PTAL

eugenis accepted this revision.Mar 28 2018, 1:58 PM
This revision is now accepted and ready to land.Mar 28 2018, 1:58 PM

Could you commit this?

This revision was automatically updated to reflect the committed changes.