mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-23 03:06:52 -04:00
kern: fix svc bounds checking for main memory size 4GB -> 8GB (closes #1320)
This commit is contained in:
parent
b21f8a5043
commit
1c9d6b4d90
3 changed files with 6 additions and 6 deletions
|
@ -175,9 +175,9 @@ namespace ams::kern::svc {
|
|||
R_UNLESS(params.code_address + code_size - 1 <= map_end - 1, svc::ResultInvalidMemoryRegion());
|
||||
|
||||
/* Check that the number of pages is valid for the kernel address space. */
|
||||
R_UNLESS(code_num_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
||||
R_UNLESS(system_resource_num_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
||||
R_UNLESS(total_pages < (kern::MainMemorySize / PageSize), svc::ResultOutOfMemory());
|
||||
R_UNLESS(code_num_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||
R_UNLESS(system_resource_num_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||
R_UNLESS(total_pages < (kern::MainMemorySizeMax / PageSize), svc::ResultOutOfMemory());
|
||||
|
||||
/* Check that optimized memory allocation is used only for applications. */
|
||||
const bool optimize_allocs = (params.flags & ams::svc::CreateProcessFlag_OptimizeMemoryAllocation) != 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue