* [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
@ 2017-02-24 2:48 Takashi Sakamoto
2017-03-02 8:56 ` Vinod Koul
2017-03-07 14:21 ` Applied "ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer" to the asoc tree Mark Brown
0 siblings, 2 replies; 4+ messages in thread
From: Takashi Sakamoto @ 2017-02-24 2:48 UTC (permalink / raw)
To: broonie, jeeja.kp, shreyas.nc
Cc: alsa-devel, ichiro.suzuki, yukie.kato, hirotaka.furukawa,
ryotaro.shibata, Takashi Sakamoto, # v4 . 5+
In 'skl_tplg_set_module_init_data()', a pointer to 'params' member of
'struct skl_algo_data' is calculated, then casted to (u32 *) and assigned
to a member of configuration data. The configuration data is passed to the
other functions and used to process intel IPC. In this processing, the
value of member is used to get message data, however this can bring invalid
memory access in 'skl_set_module_params()' as a result of calculation of
a pointer for actual message data.
(sound/soc/intel/skylake/skl-topology.c)
skl_tplg_init_pipe_modules()
->skl_tplg_set_module_init_data() (has this bug)
->skl_tplg_set_module_params()
(sound/soc/intel/skylake/skl-messages.c)
->skl_set_module_params()
((char *)param) + data_offset
This commit fixes the bug.
Cc: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Cc: <stable@vger.kernel.org> # v4.5+
Fixes: abb740033b56 ("ASoC: Intel: Skylake: Add support to configure module params")
Signed-off-by: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
---
sound/soc/intel/skylake/skl-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index ed58b5b..2dbfb1b 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -512,7 +512,7 @@ static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
if (bc->set_params != SKL_PARAM_INIT)
continue;
- mconfig->formats_config.caps = (u32 *)&bc->params;
+ mconfig->formats_config.caps = (u32 *)bc->params;
mconfig->formats_config.caps_size = bc->size;
break;
--
2.9.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [alsa-devel] [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
2017-02-24 2:48 [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer Takashi Sakamoto
@ 2017-03-02 8:56 ` Vinod Koul
2017-03-07 14:21 ` Applied "ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer" to the asoc tree Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-03-02 8:56 UTC (permalink / raw)
To: Takashi Sakamoto
Cc: broonie, jeeja.kp, shreyas.nc, alsa-devel, hirotaka.furukawa,
ichiro.suzuki, ryotaro.shibata, # v4 . 5+,
Takashi Sakamoto, yukie.kato
On Fri, Feb 24, 2017 at 11:48:41AM +0900, Takashi Sakamoto wrote:
> In 'skl_tplg_set_module_init_data()', a pointer to 'params' member of
> 'struct skl_algo_data' is calculated, then casted to (u32 *) and assigned
> to a member of configuration data. The configuration data is passed to the
> other functions and used to process intel IPC. In this processing, the
> value of member is used to get message data, however this can bring invalid
> memory access in 'skl_set_module_params()' as a result of calculation of
> a pointer for actual message data.
>
> (sound/soc/intel/skylake/skl-topology.c)
> skl_tplg_init_pipe_modules()
> ->skl_tplg_set_module_init_data() (has this bug)
> ->skl_tplg_set_module_params()
> (sound/soc/intel/skylake/skl-messages.c)
> ->skl_set_module_params()
> ((char *)param) + data_offset
>
> This commit fixes the bug.
Thanks Takashi San for the fix
Acked-by: Vinod Koul <vinod.koul@intel.com>
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
@ 2017-03-02 8:56 ` Vinod Koul
0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2017-03-02 8:56 UTC (permalink / raw)
To: Takashi Sakamoto
Cc: alsa-devel, hirotaka.furukawa, ichiro.suzuki, ryotaro.shibata,
# v4 . 5+,
Takashi Sakamoto, broonie, shreyas.nc, jeeja.kp, yukie.kato
On Fri, Feb 24, 2017 at 11:48:41AM +0900, Takashi Sakamoto wrote:
> In 'skl_tplg_set_module_init_data()', a pointer to 'params' member of
> 'struct skl_algo_data' is calculated, then casted to (u32 *) and assigned
> to a member of configuration data. The configuration data is passed to the
> other functions and used to process intel IPC. In this processing, the
> value of member is used to get message data, however this can bring invalid
> memory access in 'skl_set_module_params()' as a result of calculation of
> a pointer for actual message data.
>
> (sound/soc/intel/skylake/skl-topology.c)
> skl_tplg_init_pipe_modules()
> ->skl_tplg_set_module_init_data() (has this bug)
> ->skl_tplg_set_module_params()
> (sound/soc/intel/skylake/skl-messages.c)
> ->skl_set_module_params()
> ((char *)param) + data_offset
>
> This commit fixes the bug.
Thanks Takashi San for the fix
Acked-by: Vinod Koul <vinod.koul@intel.com>
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
* Applied "ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer" to the asoc tree
2017-02-24 2:48 [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer Takashi Sakamoto
2017-03-02 8:56 ` Vinod Koul
@ 2017-03-07 14:21 ` Mark Brown
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2017-03-07 14:21 UTC (permalink / raw)
To: Takashi Sakamoto
Cc: alsa-devel, hirotaka.furukawa, Vinod Koul, ichiro.suzuki,
ryotaro.shibata, stable, broonie, shreyas.nc, jeeja.kp, ,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
yukie.kato@miraclelinux.com, alsa-devel@alsa-project.org
The patch
ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From d1a6fe41d3c4ff0d26f0b186d774493555ca5282 Mon Sep 17 00:00:00 2001
From: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
Date: Fri, 24 Feb 2017 11:48:41 +0900
Subject: [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong
reference of pointer
In 'skl_tplg_set_module_init_data()', a pointer to 'params' member of
'struct skl_algo_data' is calculated, then casted to (u32 *) and assigned
to a member of configuration data. The configuration data is passed to the
other functions and used to process intel IPC. In this processing, the
value of member is used to get message data, however this can bring invalid
memory access in 'skl_set_module_params()' as a result of calculation of
a pointer for actual message data.
(sound/soc/intel/skylake/skl-topology.c)
skl_tplg_init_pipe_modules()
->skl_tplg_set_module_init_data() (has this bug)
->skl_tplg_set_module_params()
(sound/soc/intel/skylake/skl-messages.c)
->skl_set_module_params()
((char *)param) + data_offset
This commit fixes the bug.
Fixes: abb740033b56 ("ASoC: Intel: Skylake: Add support to configure module params")
Signed-off-by: Takashi Sakamoto <takashi.sakamoto@miraclelinux.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org> # v4.5+
---
sound/soc/intel/skylake/skl-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c
index ed58b5b3555a..2dbfb1b24ef4 100644
--- a/sound/soc/intel/skylake/skl-topology.c
+++ b/sound/soc/intel/skylake/skl-topology.c
@@ -512,7 +512,7 @@ static int skl_tplg_set_module_init_data(struct snd_soc_dapm_widget *w)
if (bc->set_params != SKL_PARAM_INIT)
continue;
- mconfig->formats_config.caps = (u32 *)&bc->params;
+ mconfig->formats_config.caps = (u32 *)bc->params;
mconfig->formats_config.caps_size = bc->size;
break;
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-07 14:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-24 2:48 [PATCH] ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer Takashi Sakamoto
2017-03-02 8:56 ` [alsa-devel] " Vinod Koul
2017-03-02 8:56 ` Vinod Koul
2017-03-07 14:21 ` Applied "ASoC: Intel: Skylake: fix invalid memory access due to wrong reference of pointer" to the asoc tree Mark Brown
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.