lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87h66v8bsc.wl-kuninori.morimoto.gx@renesas.com>
Date: Mon, 23 Dec 2024 00:48:19 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Laurentiu Mihalcea <laurentiumihalcea111@...il.com>
Cc: Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	linux-sound@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] ASoC: simple-card-utils: fix priv->dai_props indexing


Hi Laurentiu

Thank you for the patch

> As of commit cb18cd26039f ("ASoC: soc-core: do rtd->id trick at
> snd_soc_add_pcm_runtime()") the ID stored in the PCM runtime data can
> no longer be safely used to index the priv->dai_props array. This is
> because the ID may be modified during snd_soc_add_pcm_runtime(), thus
> resulting in an ID that's no longer a valid array index.
> 
> To fix this, use the position of the dai_link stored inside the PCM
> runtime data relative to the start of the dai_link array as index into
> the priv->dai_props array.
> 
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@....com>
(snip)
> +#define runtime_simple_priv_to_props(priv, rtd)					\
> +	((priv)->dai_props + ((rtd)->dai_link - (priv)->dai_link))

Oh yes, indeed.

But I wonder it is needed not only utils, but all drivers
(= simple-card/audio-graph-card/audio-graph-card2).

Why don't you just replace macro ?

	- #define simple_priv_to_props(priv, i) // old macro
	+ #define simple_priv_to_props(priv, i) // new macro

Or, do you have any reasons ?

In replase case, we would like to have the comment not only git-log but
on header too.


Thank you for your help !!

Best regards
---
Kuninori Morimoto

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ