Skip to contentSkip to conversation

drm/amdkfd: Handle invalid event type in CRIU event restore

PATCH In review David Francis 2 participants 2 messages Jul 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Handle invalid event type in CRIU event restore

In kfd_criu_restore_event, there was no handling for the event priv data having an invalid event type. The priv data here is untrusted and can be invalid.

In that case, fail with EINVAL.

---
 drivers/gpu/drm/amd/amdkfd/kfd_events.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +3 -0
index f5fd78f0df7d..9e0f57cfa3bf 100644
@@ -452,6 +452,9 @@ int kfd_criu_restore_event(struct file *devkfd,
 
 		ret = create_other_event(p, ev, &ev_priv->event_id);
 		break;
+	default:
+		ret = -EINVAL;
+		break;
 	}
 	mutex_unlock(&p->event_mutex);
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

AMD General

Quoted 36 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of David Francis
Sent: July 21, 2026 9:38 AM
To: [email protected]
Cc: Francis, David <[email protected]>
Subject: [PATCH] drm/amdkfd: Handle invalid event type in CRIU event restore

In kfd_criu_restore_event, there was no handling for the event priv data having an invalid event type. The priv data here is untrusted and can be invalid.

In that case, fail with EINVAL.

---
 drivers/gpu/drm/amd/amdkfd/kfd_events.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +3 -1
index f5fd78f0df7d..9e0f57cfa3bf 100644
@@ -452,6 +452,9 @@ int kfd_criu_restore_event(struct file *devkfd,
 
              ret = create_other_event(p, ev, &ev_priv->event_id);
              break;
+     default:
+             ret = -EINVAL;
+             break;
      }
      mutex_unlock(&p->event_mutex);
 
--

2.34.1