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

Severity

69%

Complexity

34%

Confidentiality

165%

The coredump implementation in the Linux kernel before 5.0.10 does not use locking or other mechanisms to prevent vma layout or vma flags changes while it runs, which allows local users to obtain sensitive information, cause a denial of service, or possibly have unspecified other impact by triggering a race condition with mmget_not_zero or get_task_mm calls. This is related to fs/userfaultfd.c, mm/mmap.c, fs/proc/task_mmu.c, and drivers/infiniband/core/uverbs_main.c.

The coredump implementation in the Linux kernel before 5.0.10 does not use locking or other mechanisms to prevent vma layout or vma flags changes while it runs, which allows local users to obtain sensitive information, cause a denial of service, or possibly have unspecified other impact by triggering a race condition with mmget_not_zero or get_task_mm calls. This is related to fs/userfaultfd.c, mm/mmap.c, fs/proc/task_mmu.c, and drivers/infiniband/core/uverbs_main.c.

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

CVSS 2.0 Base Score 6.9. CVSS Attack Vector: local. CVSS Attack Complexity: medium. CVSS Vector: (AV:L/AC:M/Au:N/C:C/I:C/A:C).

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 5 years ago

2019-04-29 18:29:00

Last updated 5 years ago

2019-05-28 19:29:00

Affected Software

Linux Kernel

References

openSUSE-SU-2019:1716

openSUSE-SU-2019:1757

http://packetstormsecurity.com/files/152663/Linux-Missing-Lockdown.html

Exploit, Third Party Advisory, VDB Entry

http://packetstormsecurity.com/files/153702/Slackware-Security-Advisory-Slackware-14.2-kernel-Updates.html

[oss-security] 20190429 Linux kernel: multiple issues

Mailing List, Third Party Advisory

[oss-security] 20190429 Re: Linux kernel: multiple issues

Mailing List, Third Party Advisory

[oss-security] 20190430 Re: Linux kernel: multiple issues

Mailing List, Third Party Advisory

108113

Third Party Advisory, VDB Entry

RHSA-2019:2029

RHSA-2019:2043

RHSA-2019:3309

RHSA-2019:3517

RHSA-2020:0100

RHSA-2020:0103

RHSA-2020:0179

RHSA-2020:0543

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

Exploit, Mailing List, Third Party Advisory

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

Mailing List, Vendor Advisory

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

Mailing List, Vendor Advisory

https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.0.10

Mailing List, Vendor Advisory

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=04f5866e41fb70690e28397487d8bd8eea7d712a

Mailing List, Patch, Vendor Advisory

https://github.com/torvalds/linux/commit/04f5866e41fb70690e28397487d8bd8eea7d712a

Patch, Third Party Advisory

[debian-lts-announce] 20190528 [SECURITY] [DLA 1799-1] linux security update

[debian-lts-announce] 20190528 [SECURITY] [DLA 1799-2] linux security update

[debian-lts-announce] 20190618 [SECURITY] [DLA 1824-1] linux-4.9 security update

20190722 [slackware-security] Slackware 14.2 kernel (SSA:2019-202-01)

20190618 [SECURITY] [DSA 4465-1] linux security update

https://security.netapp.com/advisory/ntap-20190517-0002/

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

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

USN-4069-1

USN-4069-2

USN-4095-1

USN-4115-1

USN-4118-1

DSA-4465

46781

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.