Skip to content

Commit 384b3f7

Browse files
committed
ipc3: check type field if using UUID match
A bad IPC can mismatch UUID and type, causing downstream processes to operate differently than the matched component target. This is because get_drv will not reject the mismatch. This enforces the topology matches the UUID and type. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
1 parent 6949112 commit 384b3f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ipc/ipc3/helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static const struct comp_driver *get_drv(struct sof_ipc_comp *comp)
134134
info = container_of(clist, struct comp_driver_info,
135135
list);
136136
if (!memcmp(info->drv->uid, comp_ext->uuid,
137-
UUID_SIZE)) {
137+
UUID_SIZE) && comp->type == info->drv->type) {
138138
drv = info->drv;
139139
break;
140140
}

0 commit comments

Comments
 (0)