[PATCH 0/4] ALSA: input validation for control element writes

Takashi Iwai tiwai at suse.de
Thu Jun 9 14:02:15 CEST 2022


Hi,

this is a patch set to add a new feature to ALSA control interface,
a validation for the write to control elements.  So far we rely fully
on the driver implementation to deal with the user inputs with invalid
values (e.g. a value outside the defined range).  This patch set
allows ALSA core to verify the input values beforehand and returns the
error immediately if the validation fails.

The feature is enabled with a new Kconfig for now, as it brings a
slight performance overhead, although this could be turned on as
default in most cases, IMO.

The patch set contains a few preliminary cleanup patches.  The
essential change is only the last one.


Takashi

===

Takashi Iwai (4):
  ASoC: topology: Drop superfluous check of CONFIG_SND_CTL_VALIDATION
  ALSA: control: Rename CONFIG_SND_CTL_VALIDATION to
    CONFIG_SND_CTL_DEBUG
  ALSA: control: Drop superfluous ifdef CONFIG_SND_CTL_DEBUG
  ALSA: control: Add input validation

 include/sound/control.h  |  2 +-
 sound/core/Kconfig       | 27 ++++++++++---
 sound/core/control.c     | 87 +++++++++++++++++++++++-----------------
 sound/soc/soc-topology.c |  2 +-
 4 files changed, 73 insertions(+), 45 deletions(-)

-- 
2.35.3



More information about the Alsa-devel mailing list