Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:FrontRunner
qemu.18973
0215-ide-atapi-assert-that-the-buffer-po.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0215-ide-atapi-assert-that-the-buffer-po.patch of Package qemu.18973
From: Paolo Bonzini <pbonzini@redhat.com> Date: Tue, 1 Dec 2020 13:09:26 +0100 Subject: ide: atapi: assert that the buffer pointer is in range Git-commit: 813212288970c39b1800f63e83ac6e96588095c6 References: bsc#1181108, CVE-2020-29443 A case was reported where s->io_buffer_index can be out of range. The report skimped on the details but it seems to be triggered by s->lba == -1 on the READ/READ CD paths (e.g. by sending an ATAPI command with LBA = 0xFFFFFFFF). For now paper over it with assertions. The first one ensures that there is no overflow when incrementing s->io_buffer_index, the second checks for the buffer overrun. Note that the buffer overrun is only a read, so I am not sure if the assertion failure is actually less harmful than the overrun. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20201201120926.56559-1-pbonzini@redhat.com Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Bruce Rogers <brogers@suse.com> --- hw/ide/atapi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c index c0509c8bf5d71beb130fb049b2be..dc4813f11f5e7d29d30b5d16b385 100644 --- a/hw/ide/atapi.c +++ b/hw/ide/atapi.c @@ -307,6 +307,8 @@ void ide_atapi_cmd_reply_end(IDEState *s) s->packet_transfer_size -= size; s->elementary_transfer_size -= size; s->io_buffer_index += size; + assert(size <= s->io_buffer_total_len); + assert(s->io_buffer_index <= s->io_buffer_total_len); ide_transfer_start(s, s->io_buffer + s->io_buffer_index - size, size, ide_atapi_cmd_reply_end); ide_set_irq(s->bus);
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