clear-pkgs-linux-iot-lts2018/1029-ASoC-Intel-Common-Fix-...

37 lines
1.3 KiB
Diff
Raw Permalink Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cezary Rojewski <cezary.rojewski@intel.com>
Date: Mon, 18 Feb 2019 10:37:03 +0100
Subject: [PATCH] ASoC: Intel: Common: Fix NULL dereference for tx_wait_done.
rx_data and rx_bytes present for tx_wait_done are optional parameters.
If not provided, function should not attempt to copy received data.
This change fixes memcpy NULL pointer dereference issue occurring when
optional rx_data is NULL while received message size is non-zero.
Change-Id: I881cf2f0990ef1e4786b7e340ad14d3cb35b33c1
Tracked-On: OAM-74942
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Reviewed-by: Slawinski, AmadeuszX <amadeuszx.slawinski@intel.com>
Tested-by: gkblditp <gkblditp@intel.com>
Reviewed-by: Lewandowski, Gustaw <gustaw.lewandowski@intel.com>
---
sound/soc/intel/common/sst-ipc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c
2020-10-27 02:14:06 +08:00
index 81b413e3b610..3465eca8ed1d 100644
--- a/sound/soc/intel/common/sst-ipc.c
+++ b/sound/soc/intel/common/sst-ipc.c
@@ -78,7 +78,7 @@ static int tx_wait_done(struct sst_generic_ipc *ipc,
goto err;
}
- if (msg->rx_size) {
+ if (rx_data) {
if (rx_bytes != NULL)
*rx_bytes = msg->rx_size;
memcpy(rx_data, msg->rx_data, msg->rx_size);
--
https://clearlinux.org