kern: fix svc bounds checking for main memory size 4GB -> 8GB (closes #1320)

This commit is contained in:
Michael Scire
2021-01-07 03:43:09 -08:00
parent b21f8a5043
commit 1c9d6b4d90
3 changed files with 6 additions and 6 deletions

View File

@@ -99,8 +99,8 @@ namespace ams::kern::svc {
Result CreateSharedMemory(ams::svc::Handle *out, size_t size, ams::svc::MemoryPermission owner_perm, ams::svc::MemoryPermission remote_perm) {
/* Validate the size. */
R_UNLESS(0 < size && size < kern::MainMemorySize, svc::ResultInvalidSize());
R_UNLESS(util::IsAligned(size, PageSize), svc::ResultInvalidSize());
R_UNLESS(0 < size && size < kern::MainMemorySizeMax, svc::ResultInvalidSize());
R_UNLESS(util::IsAligned(size, PageSize), svc::ResultInvalidSize());
/* Validate the permissions. */
R_UNLESS(IsValidSharedMemoryPermission(owner_perm), svc::ResultInvalidNewMemoryPermission());