ASoC: max98090: Reject invalid values in custom control put()
Mark Brown
maintainerPATCH 1/2 ASoC: max98090: Reject invalid values in custom control put()
The max98090 driver has a custom put function for some controls which can only be updated in certain circumstances which makes no effort to validate that input is suitable for the control, allowing out of spec values to be written to the hardware and presented to userspace. Fix this by returning an error when invalid values are written.
--- sound/soc/codecs/max98090.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/max98090.c +3 -0
@@ -413,6 +413,9 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, val = (val >> mc->shift) & mask; +if (sel <0 || sel > mc->max) +return -EINVAL ; + *select = sel;/* Setting a volume is only valid if it is already On */
Signature · 1 line
2.30.2
Mark Brown
maintainerPATCH 2/2 ASoC: max98090: Generate notifications on changes for custom control
The max98090 driver has some custom controls which share a put() function which returns 0 unconditionally, meaning that events are not generated when the value changes. Fix that.
--- sound/soc/codecs/max98090.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98090.c +1 -1
@@ -430,7 +430,7 @@ static int max98090_put_enab_tlv(struct snd_kcontrol *kcontrol, mask << mc->shift, sel << mc->shift); -return 0 ; +return *select != val; } static const char *max98090_perf_pwr_text[] =
Signature · 1 line
2.30.2
Mark Brown
maintainerQuoted 8 lines · Mark Brown
The max98090 driver has a custom put function for some controls which can only be updated in certain circumstances which makes no effort to validate that input is suitable for the control, allowing out of spec values to be written to the hardware and presented to userspace. Fix this by returning an error when invalid values are written.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: max98090: Reject invalid values in custom control put()
commit: 2fbe467bcbfc760a08f08475eea6bbd4c2874319
[2/2] ASoC: max98090: Generate notifications on changes for custom control
commit: 13fcf676d9e102594effc686d98521ff5c90b925All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark