linux/sound/soc/sof
Peter Ujfalusi c5003f08fe
ASoC: SOF: ipc-msg-injector: Cap the rmaining to count in IPC4 mode
If user space provides smaller buffer than the IPC4 reply then it is
possible that we corrupt user space memory since the IPC4 dfs_read function
is not using the count directly in copy_to_user() due to the nature of
an IPC4 message.

Cap the remaining counter to make sure that we are not writing too much to
the user space provided buffer.

Add a check also to make sure that the buffer is at least the size of the
IPC4 header.

Fixes: 066c67624d: "ASoC: SOF: ipc-msg-injector: Add support for IPC4 messages"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20220516092442.17027-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-17 11:58:11 +01:00
..
amd ASoC: SOF: amd: add missing platform_device_unregister in acp_pci_rn_probe 2022-05-12 11:41:33 +01:00
imx ASoC: SOF: imx: Do not set the load_module ops 2022-04-29 13:06:13 +01:00
intel ASoC: SOF: Intel: HDA: Set up sof_ipc4_fw_data for IPC4 2022-05-12 11:41:30 +01:00
mediatek ASoC: SOF: mediatek: Add mt8186 ipc support 2022-05-16 12:58:13 +01:00
xtensa ASoC: SOF: dsp_arch_ops: add kernel log level parameter for oops and stack 2021-12-23 13:38:25 +00:00
compress.c ASoC: SOF: Drop 'header' parameter from tx_message() API 2022-04-04 08:39:09 +01:00
control.c ASoC: SOF: control: use pm_runtime_resume_and_get() 2022-04-27 14:15:24 +01:00
core.c ASoC: SOF: Do not check for the fw_ready callback 2022-04-25 13:58:45 +01:00
debug.c ASoC: SOF: debug: use pm_runtime_resume_and_get() 2022-04-27 14:15:25 +01:00
iomem-utils.c ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
ipc3-control.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3-loader.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3-pcm.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3-priv.h ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3-topology.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc3.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
ipc4-loader.c ASoC: SOF: IPC4: Add FW loader ops 2022-05-12 11:41:28 +01:00
ipc4-priv.h ASoC: SOF: IPC4: Add FW loader ops 2022-05-12 11:41:28 +01:00
ipc4.c ASoC: SOF: IPC4: Add FW loader ops 2022-05-12 11:41:28 +01:00
ipc.c ASoC: SOF: ipc3: Remove the ipc3-ops.h header file 2022-05-04 15:31:18 +01:00
Kconfig ASoC: SOF: Convert the generic probe support to SOF client 2022-02-10 15:19:12 +00:00
loader.c ASoC: SOF: loader: Call optional query_fw_configuration on first boot 2022-04-29 13:06:17 +01:00
Makefile ASoC: SOF: IPC4: Add FW loader ops 2022-05-12 11:41:28 +01:00
nocodec.c ASOC: SOF: simplify nocodec mode 2021-04-12 17:05:55 +01:00
ops.c ASoC: SOF: ops: Always print DSP Panic message but use different message 2021-12-23 13:38:24 +00:00
ops.h ASoC: SOF: Intel: hda: use common ops across platforms 2022-04-19 12:03:40 +01:00
pcm.c ASoC: SOF: Add a prepare op to IPC topology widget ops 2022-04-29 13:06:05 +01:00
pm.c ASoC: SOF: remove incorrect clearing of prepared flag 2022-04-25 13:58:24 +01:00
sof-acpi-dev.c ASoC: SOF: add IPC-dependent file names 2022-04-19 12:03:34 +01:00
sof-acpi-dev.h ASoC: SOF: ACPI: avoid reverse module dependency 2021-03-02 15:31:40 +01:00
sof-audio.c ASoC: SOF: Add a prepare op to IPC topology widget ops 2022-04-29 13:06:05 +01:00
sof-audio.h ASoC: SOF: Add a prepare op to IPC topology widget ops 2022-04-29 13:06:05 +01:00
sof-client-ipc-flood-test.c ASoC: SOF: Convert the generic IPC flood test into SOF client 2022-02-10 15:19:09 +00:00
sof-client-ipc-msg-injector.c ASoC: SOF: ipc-msg-injector: Cap the rmaining to count in IPC4 mode 2022-05-17 11:58:11 +01:00
sof-client-probes.c ASoC: SOF: sof-client-probes: Query the maximum IPC payload size 2022-05-09 18:17:57 +01:00
sof-client-probes.h ASoC: SOF: Convert the generic probe support to SOF client 2022-02-10 15:19:12 +00:00
sof-client.c ASoC: SOF: sof-client: IPC flood test can only work with SOF_IPC 2022-05-09 18:18:03 +01:00
sof-client.h ASoC: SOF: sof-client: Add API to get the ipc_type 2022-05-09 18:17:58 +01:00
sof-of-dev.c ASoC: SOF: add IPC-dependent file names 2022-04-19 12:03:34 +01:00
sof-of-dev.h ASoC: SOF: OF: Add shutdown callback for SOF OF device 2022-04-07 18:29:44 +01:00
sof-pci-dev.c ASoC: Pull in fixes 2022-05-04 15:30:32 +01:00
sof-pci-dev.h ASoC: SOF: pci: split PCI into different drivers 2021-03-02 15:32:00 +01:00
sof-priv.h ASoC: SOF: ipc4: Add support for mandatory message handling functionality 2022-05-05 13:24:45 +01:00
sof-utils.c ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
sof-utils.h ASoC: SOF: Split up utils.c into sof-utils and iomem-utils 2022-02-10 15:19:04 +00:00
stream-ipc.c ASoC: SOF: Remove ipc_pcm_params() ops 2022-03-11 13:41:09 +00:00
topology.c ASoC: SOF: topology: Skip parsing DAI link tokens if not needed 2022-04-29 13:06:03 +01:00
trace.c ASoC: SOF: trace: The dtrace is only available with SOF_IPC 2022-05-09 19:46:39 +01:00