mirror of https://github.com/torvalds/linux.git
ALSA: usb-audio: Add validation of UAC2/UAC3 effect units
Just add fixed struct size validations for UAC2 and UAC3 effect units. The descriptor has a variable-length array, so it should be validated with a proper function later once when the unit is really parsed and used by the driver (currently only referred partially for the input terminal parsing). Link: https://patch.msgid.link/20250821151751.12100-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
8ea3449574
commit
2aec0b6a6b
|
|
@ -266,7 +266,11 @@ static const struct usb_desc_validator audio_validators[] = {
|
|||
FUNC(UAC_VERSION_2, UAC_MIXER_UNIT, validate_mixer_unit),
|
||||
FUNC(UAC_VERSION_2, UAC_SELECTOR_UNIT, validate_selector_unit),
|
||||
FUNC(UAC_VERSION_2, UAC_FEATURE_UNIT, validate_uac2_feature_unit),
|
||||
/* UAC_VERSION_2, UAC2_EFFECT_UNIT: not implemented yet */
|
||||
/* just a stop-gap, it should be a proper function for the array
|
||||
* once if the unit is really parsed/used
|
||||
*/
|
||||
FIXED(UAC_VERSION_2, UAC2_EFFECT_UNIT,
|
||||
struct uac2_effect_unit_descriptor),
|
||||
FUNC(UAC_VERSION_2, UAC2_PROCESSING_UNIT_V2, validate_processing_unit),
|
||||
FUNC(UAC_VERSION_2, UAC2_EXTENSION_UNIT_V2, validate_processing_unit),
|
||||
FIXED(UAC_VERSION_2, UAC2_CLOCK_SOURCE,
|
||||
|
|
@ -286,7 +290,8 @@ static const struct usb_desc_validator audio_validators[] = {
|
|||
FUNC(UAC_VERSION_3, UAC3_MIXER_UNIT, validate_mixer_unit),
|
||||
FUNC(UAC_VERSION_3, UAC3_SELECTOR_UNIT, validate_selector_unit),
|
||||
FUNC(UAC_VERSION_3, UAC3_FEATURE_UNIT, validate_uac3_feature_unit),
|
||||
/* UAC_VERSION_3, UAC3_EFFECT_UNIT: not implemented yet */
|
||||
FIXED(UAC_VERSION_3, UAC3_EFFECT_UNIT,
|
||||
struct uac2_effect_unit_descriptor), /* sharing the same struct */
|
||||
FUNC(UAC_VERSION_3, UAC3_PROCESSING_UNIT, validate_processing_unit),
|
||||
FUNC(UAC_VERSION_3, UAC3_EXTENSION_UNIT, validate_processing_unit),
|
||||
FIXED(UAC_VERSION_3, UAC3_CLOCK_SOURCE,
|
||||
|
|
|
|||
Loading…
Reference in New Issue