accel/qaic: Ensure entry belongs to DBC in qaic_perf_stats_bo_ioctl()
Subsystems (3)
PATCH 1/1 accel/qaic: Ensure entry belongs to DBC in qaic_perf_stats_bo_ioctl()
From: Youssef Samir <[email protected]>
struct qaic_perf_stats is defined to have a DBC specified in the header, followed by struct qaic_perf_stats_entry instances, each pointing to a BO that is associated with the DBC. Currently, qaic_perf_stats_bo_ioctl() does not check if the entries belong to the DBC specified in the header. Therefore, add checks to ensure that each entry in the request is sliced and belongs to hdr.dbc_id.
--- drivers/accel/qaic/qaic_data.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/accel/qaic/qaic_data.c +10 -0
@@ -1781,6 +1781,16 @@ int qaic_perf_stats_bo_ioctl(struct drm_device *dev, void *data, struct drm_file goto free_ent; } bo =to_qaic_bo (obj); +if (!bo->sliced) { +drm_gem_object_put (obj); + ret = -EINVAL ; + goto free_ent; + } +if (bo->dbc->id != args->hdr.dbc_id) { +drm_gem_object_put (obj); + ret = -EINVAL ; + goto free_ent; + }/* * perf stats ioctl is called before wait ioctl is complete then * the latency information is invalid.
Signature · 1 line
2.43.0
Quoted 9 lines · Youssef Samir
From: Youssef Samir <[email protected]>
struct
qaic_perf_statsis defined to have a DBC specified in the header, followed by structqaic_perf_stats_entryinstances, each pointing to a BO that is associated with the DBC. Currently,qaic_perf_stats_bo_ioctl()does not check if the entries belong to the DBC specified in the header. Therefore, add checks to ensure that each entry in the request is sliced and belongs to hdr.dbc_id.
Quoted 4 lines
Co-developed-by Carl Vanderlip <[email protected]>Signed-off-by Carl Vanderlip <[email protected]>Signed-off-by Youssef Samir <[email protected]>Signed-off-by Youssef Samir <[email protected]>
Quoted 9 lines · Youssef Samir
From: Youssef Samir <[email protected]>
struct
qaic_perf_statsis defined to have a DBC specified in the header, followed by structqaic_perf_stats_entryinstances, each pointing to a BO that is associated with the DBC. Currently,qaic_perf_stats_bo_ioctl()does not check if the entries belong to the DBC specified in the header. Therefore, add checks to ensure that each entry in the request is sliced and belongs to hdr.dbc_id.
Quoted 5 lines
Co-developed-by Carl Vanderlip <[email protected]>Signed-off-by Carl Vanderlip <[email protected]>Signed-off-by Youssef Samir <[email protected]>Signed-off-by Youssef Samir <[email protected]>---
Quoted 9 lines · Youssef Samir
From: Youssef Samir <[email protected]>
struct
qaic_perf_statsis defined to have a DBC specified in the header, followed by structqaic_perf_stats_entryinstances, each pointing to a BO that is associated with the DBC. Currently,qaic_perf_stats_bo_ioctl()does not check if the entries belong to the DBC specified in the header. Therefore, add checks to ensure that each entry in the request is sliced and belongs to hdr.dbc_id.
Quoted 4 lines
Co-developed-by Carl Vanderlip <[email protected]>Signed-off-by Carl Vanderlip <[email protected]>Signed-off-by Youssef Samir <[email protected]>Signed-off-by Youssef Samir <[email protected]>
Pushed to drm-misc-next.
-Jeff