In the Linux kernel, the following vulnerability has been resolved:
drm/imagination: acquire vm_ctx->lock before mapping memory to GPU VM
The drm gpuvm code doesnt protect find operation against map operation, and the driver needs to ensure a map operation shouldnt happen when a find operation is in progress.
In some cases a find operation will be in progress when doing map/unmap operations, and the find operation will do a NULL pointer dereference.
An example of the stack trace of such NULL dereference is shown below:
| |
As all occurences of drm_gpuva_find*() are already guarded by vm_ctx->lock, make pvr_vm_map() to acquire this lock to prevent disturbing any find operation. This fixes the NULL deference problem in drm_gpuva_find*().