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
This commit is contained in:
Billy Laws 2022-10-30 16:35:34 +00:00
parent 8b523fa1f0
commit e7bab27d85

View File

@ -186,7 +186,7 @@ namespace skyline::service::nvdrv::device::nvhost {
pushBufferMemory.resize(pushBufferWords);
// Allocate pages in the GPU AS
pushBufferAddr = static_cast<u64>(asAllocator->Allocate((static_cast<u32>(pushBufferWords) >> AsGpu::VM::PageSizeBits) + 1)) << AsGpu::VM::PageSizeBits;
pushBufferAddr = static_cast<u64>(asAllocator->Allocate((static_cast<u32>(pushBufferSize) >> AsGpu::VM::PageSizeBits) + 1)) << AsGpu::VM::PageSizeBits;
if (!pushBufferAddr)
throw exception("Failed to allocate channel pushbuffer!");