]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SOF: ipc4-control: Use local copy of IPC message for sending
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 20 May 2026 14:13:49 +0000 (17:13 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 21 May 2026 11:07:52 +0000 (12:07 +0100)
commitaff152a02481c044ea5f52b08e16cc4fca893e64
treef1aefc716726e7973963cf7fcb78d9f830486eeb
parentbdb78dbd21211c8c3728305e0993fb86de7cab0b
ASoC: SOF: ipc4-control: Use local copy of IPC message for sending

If a kcontrol update comes to a control right at the same time when the
PCM containing the control is started up then there is a small window when
a race can happen:
while the widget is set up the swidget->setup_mutex is taken in topology
level and if the control update comes at this point, it will be stopped
within sof_ipc4_set_get_kcontrol_data() with the mutex and it will be
blocked until the swidget setup is done, which will clear the control's
IPC message payload.

To avoid such race, use local copy of the template IPC message instead of
the template directly. This will ensure data integrity in case of
concurrent updates during initialization.

Link: https://github.com/thesofproject/linux/issues/5734
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://patch.msgid.link/20260520141349.9625-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-control.c