Blame qemu.trad.CVE-2016-8669.patch
|
|
6e0c7aa |
From 3592fe0c919cf27a81d8e9f9b4f269553418bb01 Mon Sep 17 00:00:00 2001
|
|
|
6e0c7aa |
From: Prasad J Pandit <pjp@fedoraproject.org>
|
|
|
6e0c7aa |
Date: Wed, 12 Oct 2016 11:28:08 +0530
|
|
|
6e0c7aa |
Subject: [PATCH] char: serial: check divider value against baud base
|
|
|
6e0c7aa |
|
|
|
6e0c7aa |
16550A UART device uses an oscillator to generate frequencies
|
|
|
6e0c7aa |
(baud base), which decide communication speed. This speed could
|
|
|
6e0c7aa |
be changed by dividing it by a divider. If the divider is
|
|
|
6e0c7aa |
greater than the baud base, speed is set to zero, leading to a
|
|
|
6e0c7aa |
divide by zero error. Add check to avoid it.
|
|
|
6e0c7aa |
|
|
|
6e0c7aa |
Reported-by: Huawei PSIRT <psirt@huawei.com>
|
|
|
6e0c7aa |
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
|
|
|
6e0c7aa |
Message-Id: <1476251888-20238-1-git-send-email-ppandit@redhat.com>
|
|
|
6e0c7aa |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
6e0c7aa |
---
|
|
|
6e0c7aa |
hw/char/serial.c | 3 ++-
|
|
|
6e0c7aa |
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
|
6e0c7aa |
|
|
|
6e0c7aa |
diff --git a/hw/serial.c b/hw/serial.c
|
|
|
6e0c7aa |
index 3442f47..eec72b7 100644
|
|
|
6e0c7aa |
--- a/hw/serial.c
|
|
|
6e0c7aa |
+++ b/hw/serial.c
|
|
|
6e0c7aa |
@@ -153,8 +153,9 @@ static void serial_update_parameters(SerialState *s)
|
|
|
6e0c7aa |
int speed, parity, data_bits, stop_bits, frame_size;
|
|
|
6e0c7aa |
QEMUSerialSetParams ssp;
|
|
|
6e0c7aa |
|
|
|
6e0c7aa |
- if (s->divider == 0)
|
|
|
6e0c7aa |
+ if (s->divider == 0 || s->divider > s->baudbase) {
|
|
|
6e0c7aa |
return;
|
|
|
6e0c7aa |
+ }
|
|
|
6e0c7aa |
|
|
|
6e0c7aa |
frame_size = 1;
|
|
|
6e0c7aa |
if (s->lcr & 0x08) {
|
|
|
6e0c7aa |
--
|
|
|
6e0c7aa |
1.7.0.4
|
|
|
6e0c7aa |
|