CVE-2019-6974 - Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

Severity

68%

Complexity

86%

Confidentiality

106%

In the Linux kernel before 4.20.8, kvm_ioctl_create_device in virt/kvm/kvm_main.c mishandles reference counting because of a race condition, leading to a use-after-free.

In the Linux kernel before 4.20.8, kvm_ioctl_create_device in virt/kvm/kvm_main.c mishandles reference counting because of a race condition, leading to a use-after-free.

CVSS 3.0 Base Score 8.1. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 6.8. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:P/I:P/A:P).

Demo Examples

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

This code could be used in an e-commerce application that supports transfers between accounts. It takes the total amount of the transfer, sends it to the new account, and deducts the amount from the original account.


               
NotifyUser("New balance: $newbalance");
FatalError("Bad Transfer Amount");
FatalError("Insufficient Funds");

A race condition could occur between the calls to GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Suppose the balance is initially 100.00. An attack could be constructed as follows:


               
PROGRAM-2 sends a request to update the database, setting the balance to 99.00

At this stage, the attacker should have a balance of 19.00 (due to 81.00 worth of transfers), but the balance is 99.00, as recorded in the database.

To prevent this weakness, the programmer has several options, including using a lock to prevent multiple simultaneous requests to the web application, or using a synchronization mechanism that includes all the code between GetBalanceFromDatabase() and SendNewBalanceToDatabase().

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

The following function attempts to acquire a lock in order to perform operations on a shared resource.


               
}
pthread_mutex_unlock(mutex);/* access shared resource */

However, the code does not check the value returned by pthread_mutex_lock() for errors. If pthread_mutex_lock() cannot acquire the mutex for any reason, the function may introduce a race condition into the program and result in undefined behavior.

In order to avoid data races, correctly written programs must check the result of thread synchronization functions and appropriately handle all errors, either by attempting to recover from them or reporting it to higher levels.


               
}
return pthread_mutex_unlock(mutex);
return result;
/* access shared resource */

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

CWE-362

Suppose a processor's Memory Management Unit (MMU) has 5 other shadow MMUs to distribute its workload for its various cores. Each MMU has the start address and end address of "accessible" memory. Any time this accessible range changes (as per the processor's boot status), the main MMU sends an update message to all the shadow MMUs.

Suppose the interconnect fabric does not prioritize such "update" packets over other general traffic packets. This introduces a race condition. If an attacker can flood the target with enough messages so that some of those attack packets reach the target before the new access ranges gets updated, then the attacker can leverage this scenario.

Overview

First reported 6 years ago

2019-02-15 15:29:00

Last updated 5 years ago

2019-09-20 14:15:00

Affected Software

Linux Kernel

Debian Linux 8.0 (Jessie)

8.0

Canonical Ubuntu Linux 12.04 ESM (Extended Security Maintenance)

12.04

Canonical Ubuntu Linux 14.04 LTS (Long-Term Support)

14.04

Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)

16.04

Canonical Ubuntu Linux 18.04 LTS Edition

18.04

Canonical Ubuntu Linux 18.10

18.10

F5 Big-IP Access Policy Manager (APM)

F5 Big-IP Advanced Firewall Manager (AFM)

F5 Big-IP Analytics

F5 Big-IP Application Acceleration Manager (AAM)

F5 Big-IP Application Security Manager (ASM)

F5 Big-IP Edge Gateway

F5 Big-IP Fraud Protection Service (FPS)

F5 Big-IP Global Traffic Manager (GTM)

F5 Big-IP Link Controller

F5 Networks Big-IP Local Traffic Manager (LTM)

F5 Big-IP Policy Enforcement Manager (PEM)

F5 Big-IP WebAccelerator

Red Hat OpenShift Container Platform 3.11

3.11

Red Hat Enterprise Linux (RHEL) 7.0 (7)

7.0

RedHat Enterprise Linux Desktop 7.0

7.0

RedHat Enterprise Linux Server 7.0

7.0

Red Hat Enterprise Linux Server Advanced mission critical Update Support (AUS) 7.6

7.6

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.6

7.6

Red Hat Enterprise Linux Server Telecommunications Update Service (TUS) 7.6

7.6

RedHat Enterprise Linux Workstation 7.0

7.0

Red Hat Virtualization 4.0

4.0

References

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cfa39381173d5f969daf43582c95ad679189cbc9

Mailing List, Patch, Vendor Advisory

107127

Third Party Advisory, VDB Entry

RHBA-2019:0959

Third Party Advisory

RHSA-2019:0818

Third Party Advisory

RHSA-2019:0833

Third Party Advisory

RHSA-2019:2809

RHSA-2019:3967

RHSA-2020:0103

https://bugs.chromium.org/p/project-zero/issues/detail?id=1765

Exploit, Mailing List, Patch, Third Party Advisory

https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.14.99

Vendor Advisory

https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.19.21

Vendor Advisory

https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.20.8

Vendor Advisory

https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.9.156

Vendor Advisory

https://github.com/torvalds/linux/commit/cfa39381173d5f969daf43582c95ad679189cbc9

Exploit, Patch, Third Party Advisory

[debian-lts-announce] 20190327 [SECURITY] [DLA 1731-1] linux security update

Mailing List, Third Party Advisory

[debian-lts-announce] 20190401 [SECURITY] [DLA 1731-2] linux regression update

Mailing List, Third Party Advisory

[debian-lts-announce] 20190503 [SECURITY] [DLA 1771-1] linux-4.9 security update

Mailing List, Third Party Advisory

https://support.f5.com/csp/article/K11186236

Third Party Advisory

https://support.f5.com/csp/article/K11186236?utm_source=f5support&utm_medium=RSS

USN-3930-1

Third Party Advisory

USN-3930-2

Third Party Advisory

USN-3931-1

Third Party Advisory

USN-3931-2

Third Party Advisory

USN-3932-1

Third Party Advisory

USN-3932-2

Third Party Advisory

USN-3933-1

Third Party Advisory

USN-3933-2

Third Party Advisory

46388

Exploit, Third Party Advisory, VDB Entry

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.