Bug 1182654

Summary: VUL-1: CVE-2021-20255: xen: eepro100: stack overflow via infinite recursion
Product: [Novell Products] SUSE Security Incidents Reporter: Gianluca Gabrielli <gianluca.gabrielli>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED FIXED QA Contact: Security Team bot <security-team>
Severity: Minor    
Priority: P4 - Low CC: atoptsoglou, carnold, smash_bz
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/278333/
Whiteboard:
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Gianluca Gabrielli 2021-02-24 09:55:10 UTC
+++ This bug was initially created as a clone of Bug #1182651 +++

CVE-2021-20255

A stack overflow via an infinite recursion vulnerability was found in the eepro100 i8255x device emulator of QEMU. This issue occurs while processing controller commands due to a DMA reentry issue. This flaw allows a guest user or process to consume CPU cycles or crash the QEMU process on the host, resulting in a denial of service. The highest threat from this vulnerability is to system availability.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-20255
https://access.redhat.com/security/cve/CVE-2021-20255
Comment 1 Gianluca Gabrielli 2021-02-24 09:56:30 UTC
Upstream patch in GNU ML [0].

Affected packages:

 * SUSE:SLE-11-SP3:Update:Teradata/xen

--
[0] https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg06098.html
Comment 2 Gianluca Gabrielli 2021-02-26 11:34:26 UTC
Also the following packages seems to be affected:

 * SUSE:SLE-11-SP4:Update/xen
 * SUSE:SLE-11-SP3:Update:Teradata/xen
Comment 3 Charles Arnold 2021-04-09 09:24:16 UTC
Here is the proposed fix but the discussion upstream seems unresolved.

diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index 16e95ef9cc..2474cf3dc2 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -279,6 +279,9 @@ typedef struct {
     /* Quasi static device properties (no need to save them). */
     uint16_t stats_size;
     bool has_extended_tcb_support;
+
+    /* Flag to avoid recursions. */
+    bool busy;
 } EEPRO100State;

 /* Word indices in EEPROM. */
@@ -837,6 +840,14 @@ static void action_command(EEPRO100State *s)
        Therefore we limit the number of iterations. */
     unsigned max_loop_count = 16;

+    if (s->busy) {
+        /* Prevent recursions. */
+        logout("recursion in %s:%u\n", __FILE__, __LINE__);
+        return;
+    }
+
+    s->busy = true;
+
     for (;;) {
         bool bit_el;
         bool bit_s;
@@ -933,6 +944,7 @@ static void action_command(EEPRO100State *s)
     }
     TRACE(OTHER, logout("CU list empty\n"));
     /* List is empty. Now CU is idle or suspended. */
+    s->busy = false;
 }

 static void eepro100_cu_command(EEPRO100State * s, uint8_t val)
Comment 7 Swamp Workflow Management 2021-09-02 13:41:58 UTC
# maintenance_jira_update_notice
SUSE-SU-2021:2924-1: An update that solves 15 vulnerabilities and has 6 fixes is now available.

Category: security (important)
Bug References: 1027519,1179246,1180491,1180846,1182654,1183243,1185682,1186428,1186429,1186433,1186434,1187369,1187376,1187378,1188050,1189373,1189376,1189378,1189380,1189381,1189882
CVE References: CVE-2021-0089,CVE-2021-20255,CVE-2021-28690,CVE-2021-28692,CVE-2021-28693,CVE-2021-28694,CVE-2021-28695,CVE-2021-28696,CVE-2021-28697,CVE-2021-28698,CVE-2021-28699,CVE-2021-28700,CVE-2021-3592,CVE-2021-3594,CVE-2021-3595
JIRA References: 
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP5 (src):    xen-4.12.4_12-3.49.1
SUSE Linux Enterprise Server 12-SP5 (src):    xen-4.12.4_12-3.49.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 8 Swamp Workflow Management 2021-09-03 16:29:16 UTC
# maintenance_jira_update_notice
SUSE-SU-2021:2955-1: An update that fixes 14 vulnerabilities is now available.

Category: security (important)
Bug References: 1181254,1182654,1186429,1186433,1186434,1187369,1187376,1187378,1189373,1189376,1189378,1189380,1189882
CVE References: CVE-2021-0089,CVE-2021-20255,CVE-2021-28690,CVE-2021-28692,CVE-2021-28694,CVE-2021-28695,CVE-2021-28696,CVE-2021-28697,CVE-2021-28698,CVE-2021-28699,CVE-2021-3308,CVE-2021-3592,CVE-2021-3594,CVE-2021-3595
JIRA References: 
Sources used:
SUSE OpenStack Cloud Crowbar 9 (src):    xen-4.11.4_20-2.60.1
SUSE OpenStack Cloud 9 (src):    xen-4.11.4_20-2.60.1
SUSE Linux Enterprise Server for SAP 12-SP4 (src):    xen-4.11.4_20-2.60.1
SUSE Linux Enterprise Server 12-SP4-LTSS (src):    xen-4.11.4_20-2.60.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 9 Swamp Workflow Management 2021-09-06 13:16:46 UTC
# maintenance_jira_update_notice
SUSE-SU-2021:2957-1: An update that fixes 13 vulnerabilities is now available.

Category: security (important)
Bug References: 1182654,1186429,1186433,1186434,1187369,1187376,1187378,1189373,1189376,1189378,1189380,1189882
CVE References: CVE-2021-0089,CVE-2021-20255,CVE-2021-28690,CVE-2021-28692,CVE-2021-28694,CVE-2021-28695,CVE-2021-28696,CVE-2021-28697,CVE-2021-28698,CVE-2021-28699,CVE-2021-3592,CVE-2021-3594,CVE-2021-3595
JIRA References: 
Sources used:
SUSE OpenStack Cloud Crowbar 8 (src):    xen-4.9.4_20-3.91.1
SUSE OpenStack Cloud 8 (src):    xen-4.9.4_20-3.91.1
SUSE Linux Enterprise Server for SAP 12-SP3 (src):    xen-4.9.4_20-3.91.1
SUSE Linux Enterprise Server 12-SP3-LTSS (src):    xen-4.9.4_20-3.91.1
SUSE Linux Enterprise Server 12-SP3-BCL (src):    xen-4.9.4_20-3.91.1
HPE Helion Openstack 8 (src):    xen-4.9.4_20-3.91.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 11 Swamp Workflow Management 2021-10-07 22:16:38 UTC
SUSE-SU-2021:3322-1: An update that fixes 13 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1182654,1186429,1186433,1186434,1187369,1187376,1187378,1189373,1189376,1189378,1189632,1189882
CVE References: CVE-2021-0089,CVE-2021-20255,CVE-2021-28690,CVE-2021-28692,CVE-2021-28694,CVE-2021-28695,CVE-2021-28696,CVE-2021-28697,CVE-2021-28698,CVE-2021-28701,CVE-2021-3592,CVE-2021-3594,CVE-2021-3595
JIRA References: 
Sources used:
SUSE Linux Enterprise Server 12-SP2-BCL (src):    xen-4.7.6_16-43.79.5

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 13 Swamp Workflow Management 2021-12-01 21:06:15 UTC
SUSE-SU-2021:14848-1: An update that fixes 17 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1182654,1186013,1186429,1186433,1186434,1187369,1187376,1187378,1189150,1189376,1189378,1189632,1192526,1192554,1192555,1192559
CVE References: CVE-2021-0089,CVE-2021-20255,CVE-2021-28690,CVE-2021-28692,CVE-2021-28697,CVE-2021-28698,CVE-2021-28701,CVE-2021-28703,CVE-2021-28705,CVE-2021-28706,CVE-2021-28709,CVE-2021-3527,CVE-2021-3592,CVE-2021-3594,CVE-2021-3595,CVE-2021-3682,CVE-2021-3930
JIRA References: 
Sources used:
SUSE Linux Enterprise Server 11-SP4-LTSS (src):    xen-4.4.4_50-61.67.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    xen-4.4.4_50-61.67.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.