From e7bab27d858d084b1ad642d80e1ffa36cc21215c Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 30 Oct 2022 16:35:34 +0000 Subject: [PATCH] Fixup nvdrv channel private memory allocation This was incorrectly allocated in words, rather than bytes, meaning that guest allocations could overwrite the private memory and break inline syncpt operations --- .../cpp/skyline/services/nvdrv/devices/nvhost/gpu_channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/gpu_channel.cpp b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/gpu_channel.cpp index c0f91e11..3174c358 100644 --- a/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/gpu_channel.cpp +++ b/app/src/main/cpp/skyline/services/nvdrv/devices/nvhost/gpu_channel.cpp @@ -186,7 +186,7 @@ namespace skyline::service::nvdrv::device::nvhost { pushBufferMemory.resize(pushBufferWords); // Allocate pages in the GPU AS - pushBufferAddr = static_cast(asAllocator->Allocate((static_cast(pushBufferWords) >> AsGpu::VM::PageSizeBits) + 1)) << AsGpu::VM::PageSizeBits; + pushBufferAddr = static_cast(asAllocator->Allocate((static_cast(pushBufferSize) >> AsGpu::VM::PageSizeBits) + 1)) << AsGpu::VM::PageSizeBits; if (!pushBufferAddr) throw exception("Failed to allocate channel pushbuffer!");