# CVE-2016-5195: Linux Kernel Race Condition

> Local attackers can exploit a race condition in the Linux kernel's copy-on-write handling to gain elevated privileges.

- **Severity:** High 7.0 (`CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 3 Mar 2022 (CISA KEV)
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Nov 2016
- **Updated:** 4 Nov 2025
- **Also known as:** CVE-2016-3919, DEBIAN-CVE-2016-5195, GHSA-j68w-7qm9-fjqq, RHSA-2016:2098, RHSA-2016:2105, RHSA-2016:2106, RHSA-2016:2118, RHSA-2016:2120, RHSA-2016:2126, RHSA-2016:2127, RHSA-2016:2132, SUSE-SU-2016:2585-1, SUSE-SU-2016:2592-1, SUSE-SU-2016:2593-1, SUSE-SU-2016:2596-1, SUSE-SU-2016:2614-1, SUSE-SU-2016:2657-1, UBUNTU-CVE-2016-5195, USN-3105-1, USN-3106-1, USN-3106-2, USN-3106-3, USN-3106-4

## What is CVE-2016-5195?

CVE-2016-5195 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 10 Nov 2016. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

Race condition in mm/gup.c in the Linux kernel 2.x through 4.x before 4.8.3 allows local users to gain privileges by leveraging incorrect handling of a copy-on-write (COW) feature to write to a read-only memory mapping, as exploited in the wild in October 2016, aka "Dirty COW."

Weakness: CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

## Which versions are affected by CVE-2016-5195?

It affects 18 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `kernel` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-abi-whitelists` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-devel` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo-common-i686` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo-common-x86_64` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-devel` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-doc` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-firmware` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-headers` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `perf` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `perf-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `python-perf` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `python-perf-debuginfo` | Red Hat:enterprise_linux:6::client | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-abi-whitelists` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-devel` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo-common-i686` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo-common-x86_64` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-devel` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-doc` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-firmware` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-headers` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `perf` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `perf-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `python-perf` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `python-perf-debuginfo` | Red Hat:enterprise_linux:6::computenode | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-abi-whitelists` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-bootwrapper` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-debuginfo` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debug-devel` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |
| `kernel-debuginfo-common-i686` | Red Hat:enterprise_linux:6::server | All versions | 0:2.6.32-642.6.2.el6 |

Products: Canonical Ubuntu Linux, Debian Debian Linux, Fedoraproject Fedora, Linux kernel, Netapp Cloud Backup, Netapp Hci Storage Nodes, Netapp Oncommand Balance, Netapp Oncommand Performance Manager, Netapp Oncommand Unified Manager for Clustered Data Ontap, Netapp Ontap Select Deploy Administration Utility, Netapp Snapprotect, Netapp Solidfire, Paloaltonetworks Pan-Os, Redhat Enterprise Linux, Redhat Enterprise Linux Aus, Redhat Enterprise Linux Eus, Redhat Enterprise Linux Long Life, Redhat Enterprise Linux Tus.

## How do I fix CVE-2016-5195?

Apply the vendor's patch. US federal agencies must fix it by 24 Mar 2022.

## Is CVE-2016-5195 being exploited?

Yes. Attackers have exploited CVE-2016-5195 in the wild since at least 3 Mar 2022.

Public exploit code:

- CVE-2016-5195 (dirtycow/dirtyc0w) proof of concept for Android (github_poc): https://github.com/timwr/CVE-2016-5195
- Dirty Cow exploit - CVE-2016-5195 (github_poc): https://github.com/firefart/dirtycow
- PoC for Dirty COW (CVE-2016-5195) (github_poc): https://github.com/scumjr/dirtycow-vdso
- A CVE-2016-5195 exploit example. (github_poc): https://github.com/gbonacini/CVE-2016-5195
- CVE-2022-0847-DirtyPipe-Exploit   CVE-2022-0847 是存在于 Linux内核 5.8 及之后版本中的本地提权漏洞。攻击者通过利用此漏洞，可覆盖重写任意可读文件中的数据，从而可将普通权限的用户提升到特权 root。    CVE-2022-0847 的漏洞原理类似于 CVE-2016-5195 脏牛漏洞（Dirty Cow），但它更容易被利用。漏洞作者将此漏洞命名为“Dirty Pipe” (github_poc): https://github.com/r1is/CVE-2022-0847
- CVE-2016-5195 (Dirty COW) PoC for Android 6.0.1 Marshmallow (github_poc): https://github.com/hyln9/VIKIROOT

## Other vulnerabilities in Canonical Ubuntu Linux

- [CVE-2020-11651](https://insights.sbomify.com/CVE-2020-11651/): SaltStack Salt Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2020-7247](https://insights.sbomify.com/CVE-2020-7247/): OpenSMTPD Remote Code Execution (critical 9.8, exploited in the wild)
- [CVE-2019-16928](https://insights.sbomify.com/CVE-2019-16928/): Exim Out-of-bounds Write (critical 9.8, exploited in the wild)
- [CVE-2018-6789](https://insights.sbomify.com/CVE-2018-6789/): Exim Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2015-2590](https://insights.sbomify.com/CVE-2015-2590/): Oracle Java SE and Java SE Embedded Remote Code Execution (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-5195 and fix it if it is affected.

What it is: CVE-2016-5195 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 10 Nov 2016. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2016-5195 in the wild since at least 3 Mar 2022.

Affected product: Canonical Ubuntu Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-5195/ (Markdown: https://insights.sbomify.com/CVE-2016-5195/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-5195
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-5195
- OSV: https://osv.dev/vulnerability/CVE-2016-5195

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-5195/
Summaries are generated and may contain mistakes; the official description above is the record.
