[PATCH v6 04/11] drm/amdgpu: validate userq buffer virtual address and size

Christian König christian.koenig at amd.com
Tue Jul 15 08:41:08 UTC 2025


On 15.07.25 10:19, Liang, Prike wrote:
>>> +   /* Validate the userq virtual address.*/
>>> +   if (amdgpu_userq_input_va_validate(&fpriv->vm, args->in.queue_va, args-
>>> in.queue_size) ||
>>> +       amdgpu_userq_input_va_validate(&fpriv->vm, args->in.rptr_va,
>> PAGE_SIZE) ||
>>> +       amdgpu_userq_input_va_validate(&fpriv->vm, args->in.wptr_va,
>> PAGE_SIZE)) {
>>> +           drm_file_err(uq_mgr->file, "Usermode queue input virt address is
>>> +invalid\n");
>>
>> No error message on invalid userspace parameters please.
> OK, why can't give the alert log for the invalid user case?
> It's useful for catching the userq invalid VA/size case, how about change the error message to a debug level?

Never ever write into the system log that userspace did something wrong. That allows userspace to spam the log.

Only every write when the HW or the kernel detects that something is wrong. E.g. not responding HW or similar.

Regards,
Christian.

> 
>> Apart from those comments looks like the right thing to do to me.
>>
>> Regards,
>> Christian.


More information about the amd-gfx mailing list