ladybird/Userland/DevTools/UserspaceEmulator
Daniel Bertalan 87ef2718bc UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in malloc
It was fragile to use the address of the body of the memory management
functions to disable memory auditing within them. Functions called from
these did not get exempted from the audits, so in some cases
UserspaceEmulator reported bogus heap buffer overflows.

Memory auditing did not work at all on Clang because when querying the
addresses, their offset was taken relative to the base of `.text` which
is not the first segment in the `R/RX/RW(RELRO)/RW(non-RELRO)` layout
produced by LLD.

Similarly to when setting metadata about the allocations, we now use the
`emuctl` system call to selectively suppress auditing when we reach
these functions. This ensures that functions called from `malloc` are
affected too, and no issues occur because of the inconsistency between
Clang and GCC memory layouts.
2021-08-14 18:42:14 +02:00
..
CMakeLists.txt UserspaceEmulator: Move to using the new SoftFPU 2021-07-22 23:33:21 +02:00
Emulator_syscalls.cpp UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in malloc 2021-08-14 18:42:14 +02:00
Emulator.cpp UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in malloc 2021-08-14 18:42:14 +02:00
Emulator.h UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in malloc 2021-08-14 18:42:14 +02:00
EmulatorControl.h UserspaceEmulator+LibC: Add support for Region-of-Interest profiling 2021-08-10 05:13:44 +04:30
main.cpp UserspaceEmulator: Move all the profiling details into the Emulator 2021-08-10 05:13:44 +04:30
MallocTracer.cpp UserspaceEmulator+LibC: Use sys$emuctl() to disable auditing in malloc 2021-08-14 18:42:14 +02:00
MallocTracer.h LibC+UE: Keep more unused chunked blocks around 2021-05-23 19:31:39 +02:00
MmapRegion.cpp UserspaceEmulator: Prefix MmapRegions' name with '(UE)' 2021-08-14 18:42:14 +02:00
MmapRegion.h UserspaceEmulator: Prefix MmapRegions' name with '(UE)' 2021-08-14 18:42:14 +02:00
Range.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Range.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
RangeAllocator.cpp Everywhere: Sort out superfluous QuickSort.h imports 2021-05-29 23:41:54 +01:00
RangeAllocator.h DevTools: Remove redundant default destructor and forward declarations 2021-05-21 22:53:33 +01:00
Region.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Region.h AK+LibX86: Generalize u128/256 to AK::UFixedBigInt 2021-06-11 18:14:11 +04:30
Report.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SimpleRegion.cpp UserpaceEmulator: Handle possibly unaligned IO 2021-07-14 11:26:34 +04:30
SimpleRegion.h UE+LibX86: Support bigger reads and writes 2021-04-23 22:50:53 +02:00
SoftCPU.cpp UserspaceEmulator: Make call rm32 work with address on the stack 2021-08-14 18:42:14 +02:00
SoftCPU.h UserspaceEmulator: Move to using the new SoftFPU 2021-07-22 23:33:21 +02:00
SoftFPU.cpp UserspaceEmulator: Implement SoftFPU instructions 2021-07-22 23:33:21 +02:00
SoftFPU.h UserspaceEmulator: Sketch out a SoftFPU interface 2021-07-22 23:33:21 +02:00
SoftMMU.cpp Userland: Replace VERIFY(is<T>) with verify_cast<T> 2021-06-24 21:13:09 +02:00
SoftMMU.h UserspaceEmulator: Make symbolication work when .text isn't the first 2021-08-08 10:55:36 +02:00
ValueWithShadow.h AK+LibX86: Generalize u128/256 to AK::UFixedBigInt 2021-06-11 18:14:11 +04:30