mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
nv_rs_rmapi_register_external_sgt() (GEM_EXPORT_DMABUF_MEMORY bridge, #587) copied the importer's sg_dma_address() values verbatim into external_dma_addrs[], which page_dma/page_dma_batch hand straight to GPU sysmem PTEs. Nothing checked them against the GPU's addressing width, so on GV11B (dma_bits = 40, platform_driver.c) a scatterlist mapped for a different/wider device would be silently truncated by the MMU. Refuse any segment ending past DMA_BIT_MASK(dma_bits) with -EINVAL, before the RM object is created (caller keeps ownership). Also derive page_dma_batch's renegotiation width from nv_rs_rmapi_gpu_dma_bits() like page_dma does instead of a literal 47 (no behaviour change: negotiate already clamps to the node's width). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>