From 90f8474fc183387f6d2daa437dcba4f88ced9b33 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 14 Oct 2018 14:44:38 -0400 Subject: svc: Clarify enum values for AddressSpaceBaseAddr and AddressSpaceSize in svcGetInfo() So, one thing that's puzzled me is why the kernel seemed to *not* use the direct code address ranges in some cases for some service functions. For example, in svcMapMemory, the full address space width is compared against for validity, but for svcMapSharedMemory, it compares against 0xFFE00000, 0xFF8000000, and 0x7FF8000000 as upper bounds, and uses either 0x200000 or 0x8000000 as the lower-bounds as the beginning of the compared range. Coincidentally, these exact same values are also used in svcGetInfo, and also when initializing the user address space, so this is actually retrieving the ASLR extents, not the extents of the address space in general. --- src/core/hle/kernel/vm_manager.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/hle/kernel/vm_manager.h') diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index 015559a64..4accde6b3 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -205,6 +205,15 @@ public: /// Gets the address space width in bits. u64 GetAddressSpaceWidth() const; + /// Gets the base address of the ASLR region. + VAddr GetASLRRegionBaseAddress() const; + + /// Gets the end address of the ASLR region. + VAddr GetASLRRegionEndAddress() const; + + /// Gets the size of the ASLR region + u64 GetASLRRegionSize() const; + /// Gets the base address of the code region. VAddr GetCodeRegionBaseAddress() const; @@ -306,6 +315,9 @@ private: VAddr address_space_base = 0; VAddr address_space_end = 0; + VAddr aslr_region_base = 0; + VAddr aslr_region_end = 0; + VAddr code_region_base = 0; VAddr code_region_end = 0; -- cgit v1.2.3