// For flags

CVE-2017-1000405

Linux Kernel - 'The Huge Dirty Cow' Overwriting The Huge Zero Page

Severity Score

7.0
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

3
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

The Linux Kernel versions 2.6.38 through 4.14 have a problematic use of pmd_mkdirty() in the touch_pmd() function inside the THP implementation. touch_pmd() can be reached by get_user_pages(). In such case, the pmd will become dirty. This scenario breaks the new can_follow_write_pmd()'s logic - pmd can become dirty without going through a COW cycle. This bug is not as severe as the original "Dirty cow" because an ext4 file (or any other regular file) cannot be mapped using THP. Nevertheless, it does allow us to overwrite read-only huge pages. For example, the zero huge page and sealed shmem files can be overwritten (since their mapping can be populated using THP). Note that after the first write page-fault to the zero page, it will be replaced with a new fresh (and zeroed) thp.

El kernel de Linux desde la versión 2.6.38 hasta la 4.14 presenta un uso problemático de pmd_mkdirty() en la función touch_pmd() dentro de la implementación THP. Se puede llegar a touch_pmd() con get_user_pages(). En ese caso, el pmd se ensuciaría. Este escenario rompe la nueva lógica de can_follow_write_pmd(). pmd puede contaminarse sin pasar por un ciclo COW. Este fallo no es tan severo como el error original "Dirty COW" porque un archivo ext4 (o cualquier otro archivo normal) no puede ser mapeado usando THP. Sin embargo, permite sobrescribir huge pages de solo lectura. Por ejemplo, los archivos shmem sellados y huge pages con ceros pueden sobrescribirse (ya que se pueden mapear con THP). Tenga en cuenta que después del primer error de escritura de página en la página con cero, se reemplazará por un nuevo thp (y con ceros).

A flaw was found in the patches used to fix the 'dirtycow' vulnerability (CVE-2016-5195). An attacker, able to run local code, can exploit a race condition in transparent huge pages to modify usually read-only huge pages.

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
Low
Attack Vector
Local
Attack Complexity
Medium
Authentication
None
Confidentiality
Complete
Integrity
Complete
Availability
Complete
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2017-11-29 CVE Reserved
  • 2017-11-30 CVE Published
  • 2017-12-11 First Exploit
  • 2024-08-05 CVE Updated
  • 2024-08-13 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 3.2.87 < 3.3
Search vendor "Linux" for product "Linux Kernel" and version " >= 3.2.87 < 3.3"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 3.10.106 < 3.11
Search vendor "Linux" for product "Linux Kernel" and version " >= 3.10.106 < 3.11"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 3.12.73 < 3.13
Search vendor "Linux" for product "Linux Kernel" and version " >= 3.12.73 < 3.13"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 3.16.42 < 3.16.52
Search vendor "Linux" for product "Linux Kernel" and version " >= 3.16.42 < 3.16.52"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 3.18.55 < 3.18.86
Search vendor "Linux" for product "Linux Kernel" and version " >= 3.18.55 < 3.18.86"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.1.41 < 4.1.48
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.1.41 < 4.1.48"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.4.70 < 4.4.104
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.4.70 < 4.4.104"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.9.7 < 4.9.67
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.9.7 < 4.9.67"
-
Affected
Linux
Search vendor "Linux"
Linux Kernel
Search vendor "Linux" for product "Linux Kernel"
>= 4.10 < 4.14.4
Search vendor "Linux" for product "Linux Kernel" and version " >= 4.10 < 4.14.4"
-
Affected