drm/amdkfd: Check bounds on CRIU restore event id
Subsystems (3)
PATCH 1/1 drm/amdkfd: Check bounds on CRIU restore event id
The valid amdkfd event ids go from 0 to KFD_SIGNAL_EVENT_LIMIT - 1.
During CRIU restore, ensure that the provided event ids are in that range.
(The CRIU input is a uint32_t, so it can't be negative, but check just for the sake of the function being clear)
Signed-off-by David Francis <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_events.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +3 -0
@@ -107,6 +107,9 @@ static int allocate_event_notification_slot(struct kfd_process *p, }if (restore_id) { +if (*restore_id <=0 || *restore_id >=KFD_SIGNAL_EVENT_LIMIT ) +return -EINVAL ; + id =idr_alloc (&p->event_idr, ev, *restore_id, *restore_id +1 ,GFP_KERNEL ); }else {
Signature · 1 line
2.34.1