Skip to content

Commit

Permalink
ASoC: ab8500-codec: info leak in anc_status_control_put()
Browse files Browse the repository at this point in the history
If the user passes an invalid value it leads to an info leak when we
print the error message or it could oops.  This is called with user
supplied data from snd_ctl_elem_write().

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
  • Loading branch information
Dan Carpenter authored and broonie committed Sep 13, 2013
1 parent 5df498a commit d63733a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/codecs/ab8500-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,18 @@ static int anc_status_control_put(struct snd_kcontrol *kcontrol,
struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(codec->dev);
struct device *dev = codec->dev;
bool apply_fir, apply_iir;
int req, status;
unsigned int req;
int status;

dev_dbg(dev, "%s: Enter.\n", __func__);

mutex_lock(&drvdata->anc_lock);

req = ucontrol->value.integer.value[0];
if (req >= ARRAY_SIZE(enum_anc_state)) {
status = -EINVAL;
goto cleanup;
}
if (req != ANC_APPLY_FIR_IIR && req != ANC_APPLY_FIR &&
req != ANC_APPLY_IIR) {
dev_err(dev, "%s: ERROR: Unsupported status to set '%s'!\n",
Expand Down

0 comments on commit d63733a

Please sign in to comment.