The read/write flag is set by manually decoding the instruction that caused the exception. It is implemented this way because the the cause register which contains the needed flag was removed from the signal context structure which the user handler receives from the kernel.
Details
Diff Detail
Event Timeline
lib/sanitizer_common/sanitizer_linux.cc | ||
---|---|---|
1741–1742 | Use uint32_t here. | |
1753 | You need to add s(w|d)(l|r) under an #ifdef __mips_isa_rev < 6 clause. | |
1763 | You need to add l(w|d)(l|r) under an #ifdef __mips_isa_rev < 6 clause. | |
1763 | You may also want to add lwpc and lwupc to this list as well, but they are only for MIPSR6. | |
test/sanitizer_common/TestCases/Posix/illegal_read_test.cc | ||
11 | Add: return 0; here. | |
test/sanitizer_common/TestCases/Posix/illegal_write_test.cc | ||
10 | Add: return 0; here. |
LGTM. Keep on eye on the buildbots when you commit this in case there are sanitizer implementations can't distinguish between illegal reads and writes.
This should be:
not __mips64 as asan can be built for MIPS32.