Message ID | 20220420193454.2647908-1-broonie@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 2fbe467bcbfc760a08f08475eea6bbd4c2874319 |
Headers | show |
Series | [1/2] ASoC: max98090: Reject invalid values in custom control put() | expand |
On Wed, 20 Apr 2022 20:34:53 +0100, Mark Brown wrote: > 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: 13fcf676d9e102594effc686d98521ff5c90b925 All 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
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index b45ec35cd63c..6d9261346842 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -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 */
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. Signed-off-by: Mark Brown <broonie@kernel.org> --- sound/soc/codecs/max98090.c | 3 +++ 1 file changed, 3 insertions(+)