summaryrefslogtreecommitdiff
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-06-09 15:02:19 +0300
committerTakashi Iwai <tiwai@suse.de>2022-06-15 08:45:28 +0300
commitf5e829f92a494a0b66d309497bab4e9d10d4ce3e (patch)
tree291439188b9d68267c060514dd02f86d924a4499 /include/sound
parent4e54316ad2485dedf8570fc2afa6fa6ce32db207 (diff)
downloadlinux-f5e829f92a494a0b66d309497bab4e9d10d4ce3e.tar.xz
ALSA: control: Add input validation
This patch adds a new feature to enable the validation of input data to control elements in the ALSA core side. When CONFIG_SND_CTL_INPUT_VALIDATION is set, ALSA core verifies whether the each input value via control API is in the defined ranges, also checks whether it's aligned to the defined steps. If an invalid value is detected, ALSA core returns -EINVAL error immediately without passing further to the driver's callback. So this is a kind of hardening for (badly written) drivers that have no proper error checks, at the cost of a slight performance overhead. Technically seen, this reuses a part of the existing validation code for CONFIG_SND_CTL_DEBUG case with a slight modification to suppress error prints for the input validation. Link: https://lore.kernel.org/r/20220609120219.3937-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
0 files changed, 0 insertions, 0 deletions