All of lore.kernel.org
 help / color / mirror / Atom feed
From: cezary.rojewski@intel.com
To: alsa-devel@alsa-project.org
Cc: lgirdwood@gmail.com, Cezary Rojewski <cezary.rojewski@intel.com>,
	broonie@kernel.org, tiwai@suse.com,
	pierre-louis.bossart@linux.intel.com
Subject: [PATCH 5/7] ASoC: Intel: Common: Fix NULL dereference in tx_wait_done
Date: Thu, 13 Jun 2019 21:04:34 +0200	[thread overview]
Message-ID: <20190613190436.20156-6-cezary.rojewski@intel.com> (raw)
In-Reply-To: <20190613190436.20156-1-cezary.rojewski@intel.com>

From: Cezary Rojewski <cezary.rojewski@intel.com>

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.

Signed-off-by: Cezary Rojewski <cezary.rojewski@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
index dcff13802c00..fc3340f1da3a 100644
--- a/sound/soc/intel/common/sst-ipc.c
+++ b/sound/soc/intel/common/sst-ipc.c
@@ -71,7 +71,7 @@ static int tx_wait_done(struct sst_generic_ipc *ipc,
 	} else {
 
 		/* copy the data returned from DSP */
-		if (msg->rx_size)
+		if (rx_data)
 			memcpy(rx_data, msg->rx_data, msg->rx_size);
 		ret = msg->errno;
 	}
-- 
2.17.1

  parent reply	other threads:[~2019-06-13 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-13 19:04 [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments cezary.rojewski
2019-06-13 19:04 ` [PATCH 1/7] ASoC: Intel: Skylake: Fix incorrect capture position reporting cezary.rojewski
2019-06-13 19:04 ` [PATCH 2/7] ASoC: Intel: Skylake: Use recommended SDxFMT programming sequence cezary.rojewski
2019-06-13 19:04 ` [PATCH 3/7] ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Read HIPCT extension before clearing DONE bit" to the asoc tree Mark Brown
2019-06-13 19:04 ` [PATCH 4/7] ASoC: Intel: Fix race condition in IPC rx list cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Fix race condition in IPC rx list" to the asoc tree Mark Brown
2019-06-13 19:04 ` cezary.rojewski [this message]
2019-06-26 11:32   ` Applied "ASoC: Intel: Common: Fix NULL dereference in tx_wait_done" " Mark Brown
2019-06-13 19:04 ` [PATCH 6/7] ASoC: Intel: Skylake: Reset pipeline before its deletion cezary.rojewski
2019-06-13 19:04 ` [PATCH 7/7] ASoC: Intel: Skylake: Strip T and L from TLV IPCs cezary.rojewski
2019-06-26 11:32   ` Applied "ASoC: Intel: Skylake: Strip T and L from TLV IPCs" to the asoc tree Mark Brown
2019-06-25 10:53 ` [PATCH 0/7] ASoC: Intel: Skylake: Critical IPC fixes and flow adjustments Mark Brown
2019-06-25 13:10   ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613190436.20156-6-cezary.rojewski@intel.com \
    --to=cezary.rojewski@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.