# CVE-2016-8655: Race condition in n/a

> Local attackers with CAP_NET_RAW can exploit a race condition in the Linux kernel packet socket implementation to gain privileges or cause a denial of service.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Dec 2016
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2016-8655, GHSA-3x7h-7xqw-rj45, RHSA-2017:0402, UBUNTU-CVE-2016-8655, USN-3149-1, USN-3151-1, USN-3151-2, USN-3151-3, USN-3151-4

## What is CVE-2016-8655?

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

### Official description

Race condition in net/packet/af_packet.c in the Linux kernel through 4.8.12 allows local users to gain privileges or cause a denial of service (use-after-free) by leveraging the CAP_NET_RAW capability to change a socket version, related to the packet_set_ring and packet_setsockopt functions.

Weakness: CWE-416 (Use After Free), CWE-362 (Concurrent Execution using Shared Resource with Improper Synchronization)

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

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `kernel-rt` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-debug` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-debug-debuginfo` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-debug-devel` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-debuginfo` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-debuginfo-common-x86_64` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-devel` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-doc` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-firmware` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-trace` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-trace-debuginfo` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-trace-devel` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-vanilla` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-vanilla-debuginfo` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |
| `kernel-rt-vanilla-devel` | Red Hat:enterprise_mrg:2:server:el6 | All versions | 1:3.10.0-514.rt56.215.el6rt |

Products: Canonical Ubuntu Linux, Linux kernel.

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

Apply the vendor's patch.

## Is CVE-2016-8655 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-8655 exists.

Public exploit code:

- Android attempt at PoC CVE-2016-8655 (github_poc): https://github.com/martinmullins/CVE-2016-8655_Android
- https://github.com/LakshmiDesai/CVE-2016-8655 (github_poc): https://github.com/LakshmiDesai/CVE-2016-8655
- AF_PACKET chocobo_root Privilege Escalation (metasploit)
- Linux Kernel 4.4.0 (Ubuntu 14.04/16.04 x86-64) - 'AF_PACKET' Race Condition Privilege Escalation (exploitdb)
- PoC for CVE-2016-8655 that causes a kernel panic (github_poc): https://github.com/scarvell/cve-2016-8655
- Linux af_packet.c race condition (local root) (github_poc): https://github.com/KosukeShimofuji/CVE-2016-8655

## 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-8655 and fix it if it is affected.

What it is: CVE-2016-8655 is a high-severity vulnerability in Canonical Ubuntu Linux, published on 8 Dec 2016. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2016-8655 exists.

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-8655/ (Markdown: https://insights.sbomify.com/CVE-2016-8655/index.md)
```

## Sources

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

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