This is an archive of the discontinued LLVM Phabricator instance.

AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks.

Authored by pcc on Oct 29 2020, 1:54 PM.



In a kernel (or in general in environments where bit 55 of the address
is set) the shadow base needs to point to the end of the shadow region,
not the beginning. Bit 55 needs to be sign extended into bits 52-63
of the shadow base offset, otherwise we end up loading from an invalid
address. We can do this by using SBFX instead of UBFX.

Using SBFX should have no effect in the userspace case where bit 55
of the address is clear so we do so unconditionally. I don't think
we need a ABI version bump for this (but one will come anyway when
we switch to x20 for the shadow base register).

Depends on D90422

Diff Detail

Event Timeline

pcc created this revision.Oct 29 2020, 1:54 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 29 2020, 1:54 PM
hctim accepted this revision.Oct 29 2020, 3:47 PM


This revision is now accepted and ready to land.Oct 29 2020, 3:47 PM
eugenis accepted this revision.Oct 29 2020, 4:06 PM


This revision was landed with ongoing or failed builds.Oct 30 2020, 12:53 PM
This revision was automatically updated to reflect the committed changes.