Skip to content

Upstream: IPC clarifications #653

Closed
Closed

Description

@plbossart

Comments from Takashi Iwai:

> +		if (msg->reply_size)
> +			memcpy(reply_data, msg->reply_data, msg->reply_size);

I'd add a sanity check here for avoiding a buffer overflow.
The reply buffer seems to be allocated in PAGE_SIZE.  Will it be more
than that?


> +/* find original TX message from DSP reply */
> +static struct snd_sof_ipc_msg *sof_ipc_reply_find_msg(struct snd_sof_ipc *ipc,
> +						      u32 header)
> +{
> +	struct snd_sof_dev *sdev = ipc->sdev;
> +	struct snd_sof_ipc_msg *msg;
> +
> +	header = SOF_IPC_MESSAGE_ID(header);
> +
> +	list_for_each_entry(msg, &ipc->reply_list, list) {
> +		if (SOF_IPC_MESSAGE_ID(msg->header) == header)
> +			return msg;
> +	}

Is it safe to traverse the list without lock here?
There seems no lock in this and relevant code.

Activity

  1. added
    upstream blocker
    on Feb 14, 2019
  2. added
    discussion
    on Feb 27, 2019
  3. lyakh commented on Mar 19, 2019

    @lyakh
    Collaborator

    Both questions resolved by #695 - for the former a check has been added, for the latter the .reply_list doesn't exist any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionupstream blocker

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions