Skip to content

Commit ec2cbaf

Browse files
knaerzchemripard
authored andcommitted
drm/imagination: vm: Fix heap lookup condition
When conditionally checking for heap existence of a certian address in pvr_vm_bind_op_map_init the condition whether the map request comes from a user is incorrect: The context must not be the kernel-context to be a user(space) context and should be looked up in pvr_heaps. That makes addresses coming from userspace not being verfied against the defined ranges and prevents firmware loading for meta cores. Fixes: ff5f643 ("drm/imagination: Add GEM and VM related code") Signed-off-by: Alex Bee <knaerzche@gmail.com> Reviewed-by: Donald Robson <donald.robson@imgtec.com> Signed-off-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20231208170856.1748413-1-knaerzche@gmail.com
1 parent 1e9974c commit ec2cbaf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/imagination/pvr_vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pvr_vm_bind_op_map_init(struct pvr_vm_bind_op *bind_op,
225225
u64 device_addr, u64 size)
226226
{
227227
struct drm_gem_object *obj = gem_from_pvr_gem(pvr_obj);
228-
const bool is_user = vm_ctx == vm_ctx->pvr_dev->kernel_vm_ctx;
228+
const bool is_user = vm_ctx != vm_ctx->pvr_dev->kernel_vm_ctx;
229229
const u64 pvr_obj_size = pvr_gem_object_size(pvr_obj);
230230
struct sg_table *sgt;
231231
u64 offset_plus_size;

0 commit comments

Comments
 (0)