ARM: `drutil_insert_get_mem_addr` no longer works correctly on AArch64
Created by: petrochenkov
https://github.com/DynamoRIO/dynamorio/pull/5283 introduced a change to decoding of load instructions, as a result of that change load index registers can be decoded as w
registers (as opposed to x
registers as previously).
Not all places in DR are prepared to encounter a w
register in a load index context.
For example, this logic in drutil_insert_get_mem_addr_arm
reg_id_t index = opnd_get_index(memref);
// ...
reg_id_t stolen = dr_get_stolen_reg();
// ...
} else if (index == stolen) {
index = replace_stolen_reg(drcontext, bb, where, memref, dst, scratch,
scratch_used);
}
now doesn't recognize w
index
registers as stolen, because dr_get_stolen_reg()
typically returns an x
register.
This results in instrumentation being silently incorrect and drutil_insert_get_mem_addr_arm
producing incorrect addresses.
Some other places besides drutil_insert_get_mem_addr_arm
may also be affected by this change.