On 10/1/26 14:25 UTC, StDenis, Tom wrote:
> I wonder if a similar fix is needed for gprwave reads as well?

I don't think so. amdgpu_debugfs_gprwave_read() reads into a kcalloc()ed
buffer under grbm_idx_mutex and calls put_user() only after
mutex_unlock(); amdgpu_debugfs_wave_read() and amdgpu_debugfs_gpr_read()
do the same. A grep-level scan of drivers/gpu/drm/amd for
get_user()/put_user()/copy_{to,from}_user() between taking and dropping
grbm_idx_mutex or srbm_mutex finds only the four sites this patch
changes. The scan does not follow function calls made under the locks.

v2 with Vitaly's PAGE_SIZE check is being tested; I'll send it once that
run is done.

Thanks,
Mikhail

Reply via email to