Skip to content

fix(uvm): check pRmApi->Control status in nvGpuOpsSetPageDirectory#1088

Open
sdimitro wants to merge 1 commit intoNVIDIA:mainfrom
sdimitro:sdimitro/fix-595-HAVOCK-996
Open

fix(uvm): check pRmApi->Control status in nvGpuOpsSetPageDirectory#1088
sdimitro wants to merge 1 commit intoNVIDIA:mainfrom
sdimitro:sdimitro/fix-595-HAVOCK-996

Conversation

@sdimitro
Copy link
Copy Markdown

nvGpuOpsSetPageDirectory unconditionally dereferences the return value of vaspaceGetPageDirBase() after calling pRmApi->Control() for NV0080_CTRL_CMD_DMA_SET_PAGE_DIRECTORY without checking the status. If the control call fails (e.g. due to GSP RPC resource exhaustion), the error cleanup path in deviceCtrlCmdDmaSetPageDirectory_IMPL calls gvaspaceExternalRootDirRevoke which sets pExternalPDB to NULL. The subsequent vaspaceGetPageDirBase() then returns NULL, and the call to memdescGetPhysAddr() triggers a kernel NULL pointer dereference.

Add the missing status check after pRmApi->Control() and bail out with proper cleanup (re-enabling channels if externally owned, releasing locks, and freeing thread state) on failure.

nvGpuOpsSetPageDirectory unconditionally dereferences the return value
of vaspaceGetPageDirBase() after calling pRmApi->Control() for
NV0080_CTRL_CMD_DMA_SET_PAGE_DIRECTORY without checking the status.
If the control call fails (e.g. due to GSP RPC resource exhaustion),
the error cleanup path in deviceCtrlCmdDmaSetPageDirectory_IMPL calls
gvaspaceExternalRootDirRevoke which sets pExternalPDB to NULL. The
subsequent vaspaceGetPageDirBase() then returns NULL, and the call to
memdescGetPhysAddr() triggers a kernel NULL pointer dereference.

Add the missing status check after pRmApi->Control() and bail out
with proper cleanup (re-enabling channels if externally owned,
releasing locks, and freeing thread state) on failure.

Signed-off-by: Serapheim Dimitropoulos <sdimitropoulos@coreweave.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant