[alsa-devel] [Sound-open-firmware] [PATCH v4 04/14] ASoC: SOF: Add support for IPC IO between DSP and Host

Mark Brown broonie at kernel.org
Wed Feb 20 18:31:47 CET 2019


On Thu, Feb 14, 2019 at 08:56:42AM -0600, Pierre-Louis Bossart wrote:
> On 2/14/19 5:52 AM, Takashi Iwai wrote:
> > Pierre-Louis Bossart wrote:

> > > +		ret = snd_sof_dsp_get_reply(sdev, msg);
> > > +		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?

> Good point, we'll check all the info returned by the DSP and see if they
> need to be range-checked or size-checked.

I think it's better to just do the range checks even if they're not
needed right now, it's safer in case someone adds bigger messages or
there's some bug that corrupts the size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20190220/7b4318f2/attachment-0001.sig>


More information about the Alsa-devel mailing list