]> 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>
Tue, 25 Aug 2020 00:11:59 +0000 (19:11 -0500)
commitdd506af071328eae57995eacc4aa4128c5f6d8c8
tree957cd2ebbbd3def0b46826d1118985f5f2f176e8
parent387a3ac89d5cc821c4064295122dc3183b6aca69
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