Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:FrontRunner
qemu-testsuite.19805
0187-es1370-check-total-frame-count-agai.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0187-es1370-check-total-frame-count-agai.patch of Package qemu-testsuite.19805
From: Prasad J Pandit <pjp@fedoraproject.org> Date: Fri, 15 May 2020 01:36:08 +0530 Subject: es1370: check total frame count against current frame Git-commit: 369ff955a8497988d079c4e3fa1e93c2570c1c69 References: bsc#1172384, CVE-2020-13361 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> Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/audio/es1370.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 59cf2527540c9edfdca2bf204410..f64a3f9f1efd63ab5ed78ead9cf6 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -788,6 +788,9 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, int csc_bytes = (csc + 1) << d->shift; int cnt = d->frame_cnt >> 16; int size = d->frame_cnt & 0xffff; + if (size < cnt) { + return; + } int left = ((size - cnt + 1) << 2) + d->leftover; int transferred = 0; int temp = audio_MIN (max, audio_MIN (left, csc_bytes)); @@ -796,7 +799,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, addr += (cnt << 2) + d->leftover; if (index == ADC_CHANNEL) { - while (temp) { + while (temp > 0) { int acquired, to_copy; to_copy = audio_MIN ((size_t) temp, sizeof (tmpbuf)); @@ -814,7 +817,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel, else { SWVoiceOut *voice = s->dac_voice[index]; - while (temp) { + while (temp > 0) { int copied, to_copy; to_copy = audio_MIN ((size_t) temp, sizeof (tmpbuf));
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor