diff options
author | David Henningsson <david.henningsson@canonical.com> | 2016-02-05 03:05:41 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-02-05 06:35:11 -0500 |
commit | 360a8245680053619205a3ae10e6bfe624a5da1d (patch) | |
tree | b70ee8fa2da27a573b1f1218ea93acfcf1fbd39c | |
parent | 094fd3be87b0f102589e2d5c3fa5d06b7e20496d (diff) |
ALSA: hda - Fix static checker warning in patch_hdmi.c
The static checker warning is:
sound/pci/hda/patch_hdmi.c:460 hdmi_eld_ctl_get()
error: __memcpy() 'eld->eld_buffer' too small (256 vs 512)
I have a hard time figuring out if this can ever cause an information leak
(I don't think so), but nonetheless it does not hurt to increase the
robustness of the code.
Fixes: 68e03de98507 ('ALSA: hda - hdmi: Do not expose eld data when eld is invalid')
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org> # v3.9+
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 1f52b55d77c9..2191e2359315 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -448,7 +448,8 @@ static int hdmi_eld_ctl_get(struct snd_kcontrol *kcontrol, | |||
448 | eld = &per_pin->sink_eld; | 448 | eld = &per_pin->sink_eld; |
449 | 449 | ||
450 | mutex_lock(&per_pin->lock); | 450 | mutex_lock(&per_pin->lock); |
451 | if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data)) { | 451 | if (eld->eld_size > ARRAY_SIZE(ucontrol->value.bytes.data) || |
452 | eld->eld_size > ELD_MAX_SIZE) { | ||
452 | mutex_unlock(&per_pin->lock); | 453 | mutex_unlock(&per_pin->lock); |
453 | snd_BUG(); | 454 | snd_BUG(); |
454 | return -EINVAL; | 455 | return -EINVAL; |