diff options
| author | Zhu Lingshan <lingshan.zhu@amd.com> | 2026-08-13 17:36:53 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-08-19 10:06:50 -0400 |
| commit | 556488b08638aad240bdb524cebf22fa7569843c (patch) | |
| tree | b18955b3a8a3fc956ca2ded17f1b3926f2f5dadd /scripts/const_structs.checkpatch | |
| parent | 48dc279c3010ac8f91b1845b2abb3a1e9943a0f5 (diff) | |
| download | linux-556488b08638aad240bdb524cebf22fa7569843c.tar.gz linux-556488b08638aad240bdb524cebf22fa7569843c.zip | |
drm/amdgpu: validate rptr and wptr of a userq
rptr and wptr of a userq are 8 bytes aligned, and may
not placed on a page boundary.
This commit checks whether rptr and wptr are 8 bytes
aligned, and expectes 8 bytes when validates rptr/wptr VA.
With above changes, this commit fixes an regression
in amdgpu_userq_input_va_validate, where
end_addr is caculated by:
check_add_overflow(start_addr, expected_size - 1, &end_addr).
Wptr and rptr are very likely not to be page aligned,
when validating rptr and wptr, if they are located in the last
mapped page(or only one page is mapped)
and expected_size is PAGE_SIZE, end_addr will exceed the last
mapped page, means (end_addr >> AMDGPU_GPU_PAGE_SHIFT) > va_map->last,
and causing an -EINVAL, even it is a valid VA.
Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Fixes: c0122bf2ccb1 ("drm/amdgpu: fix userq VA validation for sub-page buffers")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
