On Sat, Jun 15, 2024 at 01:37:09PM +0200, Takashi Iwai wrote:
> From: Takashi Iwai <[email protected]>
> Subject: [PATCH v3] ALSA: control: Apply sanity check of input values for 
> user elements
> 
> Although we have already a mechanism for sanity checks of input values
> for control writes, it's not applied unless the kconfig
> CONFIG_SND_CTL_INPUT_VALIDATION is set due to the performance reason.
> Nevertheless, it still makes sense to apply the same check for user
> elements despite of its cost, as that's the only way to filter out the
> invalid values; the user controls are handled solely in ALSA core
> code, and there is no corresponding driver, after all.
> 
> This patch adds the same input value validation for user control
> elements at its put callback.  The kselftest will be happier with this
> change, as the incorrect values will be bailed out now with errors.
> 
> For other normal controls, the check is applied still only when
> CONFIG_SND_CTL_INPUT_VALIDATION is set.
> 
> Reported-by: Paul Menzel <[email protected]>
> Closes: 
> https://lore.kernel.org/r/[email protected]
> Reviewed-by: Jaroslav Kysela <[email protected]>
> Reviewed-by: Mark Brown <[email protected]>
> Signed-off-by: Takashi Iwai <[email protected]>
> ---
>  sound/core/control.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Reviewed-by: Takashi Sakamoto <[email protected]>


Thanks

Takashi Sakamoto

Reply via email to