]> git.ipfire.org Git - thirdparty/qemu.git/commit
es1370: check total frame count against current frame
authorPrasad J Pandit <pjp@fedoraproject.org>
Thu, 14 May 2020 20:06:08 +0000 (01:36 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 22 Jun 2020 17:15:05 +0000 (12:15 -0500)
commitc436692c6a229f35db1fe24ba60fe04013d92b25
tree0cadf248cf7f64d1b687a7a92325440b2be34b0d
parent69a6048e1ef24a65da45a0c6802ace95066f0f37
es1370: check total frame count against current frame

A guest user may set channel frame count via es1370_write()
such that, in es1370_transfer_audio(), total frame count
'size' is lesser than the number of frames that are processed
'cnt'.

    int cnt = d->frame_cnt >> 16;
    int size = d->frame_cnt & 0xffff;

if (size < cnt), it results in incorrect calculations leading
to OOB access issue(s). Add check to avoid it.

Reported-by: Ren Ding <rding@gatech.edu>
Reported-by: Hanqing Zhao <hanqing@gatech.edu>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20200514200608.1744203-1-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 369ff955a8497988d079c4e3fa1e93c2570c1c69)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/audio/es1370.c