1
0
Fork 0
forked from suyu/suyu
suyu/src/core
Lioncash 09a219d5b4 svc: Write out the complete MemoryInfo structure in QueryProcessMemory
In the previous change, the memory writing was moved into the service
function itself, however it still had a problem, in that the entire
MemoryInfo structure wasn't being written out, only the first 32 bytes
of it were being written out. We still need to write out the trailing
two reference count members and zero out the padding bits.

Not doing this can result in wrong behavior in userland code in the following
scenario:

MemoryInfo info;                 // Put on the stack, not quaranteed to be zeroed out.
svcQueryMemory(&info, ...);

if (info.device_refcount == ...) // Whoops, uninitialized read.

This can also cause the wrong thing to happen if the user code uses
std::memcmp to compare the struct, with another one (questionable, but
allowed), as the padding bits are not guaranteed to be a deterministic
value. Note that the kernel itself also fully zeroes out the structure
before writing it out including the padding bits.
2018-12-12 15:44:58 -05:00
..
arm core: Make the exclusive monitor a unique_ptr instead of a shared_ptr 2018-10-15 14:15:50 -04:00
crypto Merge pull request #1836 from lioncash/unused 2018-12-04 18:28:15 -05:00
file_sys Merge pull request #1846 from lioncash/dir 2018-12-10 21:54:03 -05:00
frontend Merge pull request #1667 from DarkLordZach/swkbd 2018-11-20 08:24:11 -08:00
gdbstub gdbstub: Silence value truncation warning within FpuWrite() 2018-11-26 19:58:23 -05:00
hle svc: Write out the complete MemoryInfo structure in QueryProcessMemory 2018-12-12 15:44:58 -05:00
loader Merge pull request #1819 from DarkLordZach/disable-addons 2018-12-10 21:52:19 -05:00
tracer Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
CMakeLists.txt Merge pull request #1704 from DarkLordZach/oss-sysarchive 2018-12-04 19:59:52 -05:00
core.cpp core: Make GetGameFileFromPath function externally accessible 2018-12-03 17:20:34 -05:00
core.h core: Make GetGameFileFromPath function externally accessible 2018-12-03 17:20:34 -05:00
core_cpu.cpp core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
core_cpu.h core_cpu: Make Cpu scheduler instances unique_ptrs instead of shared_ptrs 2018-10-15 14:15:56 -04:00
core_timing.cpp Core::CoreTiming: add UnscheduleEventThreadsafe 2018-08-13 13:56:41 +02:00
core_timing.h Core::CoreTiming: add UnscheduleEventThreadsafe 2018-08-13 13:56:41 +02:00
core_timing_util.cpp
core_timing_util.h
cpu_core_manager.cpp core: Relocate CPU core management to its own class 2018-11-22 04:28:19 -05:00
cpu_core_manager.h core: Relocate CPU core management to its own class 2018-11-22 04:28:19 -05:00
memory.cpp memory: Convert ASSERT into a DEBUG_ASSERT within GetPointerFromVMA() 2018-12-06 15:02:34 -05:00
memory.h memory: Dehardcode the use of fixed memory range constants 2018-09-24 22:16:03 -04:00
memory_hook.cpp
memory_hook.h global: Use std::optional instead of boost::optional (#1578) 2018-10-30 00:03:25 -04:00
memory_setup.h
perf_stats.cpp perf_stats: Remove unused variable within DoFrameLimiting() 2018-10-24 00:33:26 -04:00
perf_stats.h core/core: Replace includes with forward declarations where applicable 2018-08-31 16:30:14 -04:00
settings.cpp hid: Use player-defined controller type as PREFERRED_CONTROLLER 2018-11-18 23:22:36 -05:00
settings.h settings: Store list of disabled add-ons per title ID 2018-12-03 17:20:34 -05:00
telemetry_session.cpp web_service: move telemetry condition from TelemetrySession constructor to destructor 2018-12-08 14:34:37 +01:00
telemetry_session.h compatdb: Use a seperate endpoint for testcase submission 2018-10-28 13:23:02 +01:00