---
title: "CVE-2012-6704\n    | Ubuntu"
description: Ubuntu is an open source software operating system that runs from the
  desktop, to the cloud, to all your internet connected things.
url: https://ubuntu.com/security/CVE-2012-6704?format=md
keywords: index, follow
---

# CVE-2012-6704

Publication date 28 December 2016

Last updated 4 July 2026

---

Ubuntu priority

**Low**

[Why this priority?](https://ubuntu.com/security/cves/about#priority )

## Cvss 3 Severity Score

**7.8 · High**

[Score breakdown](https://ubuntu.com/security/CVE-2012-6704?format=md#impact-score)

Toggle side navigation

## Description

The sock\_setsockopt function in net/core/sock.c in the Linux kernel before
3.5 mishandles negative values of sk\_sndbuf and sk\_rcvbuf, which allows
local users to cause a denial of service (memory corruption and system
crash) or possibly have unspecified other impact by leveraging the
CAP\_NET\_ADMIN capability for a crafted setsockopt system call with the (1)
SO\_SNDBUF or (2) SO\_RCVBUF option.

[Read the notes from the security team](https://ubuntu.com/security/CVE-2012-6704?format=md#notes)

## Status

Show unmaintained releases

| Package | Ubuntu Release | Status |
| --- | --- | --- |
| linux | 17.04 zesty | Not affected |
| 16.10 yakkety | Not affected |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not affected |
| 12.04 LTS precise | Ignored end of life |
| linux-armadaxp | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-aws | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not affected |
| 12.04 LTS precise | Not in release |
| linux-flo | 17.04 zesty | Not in release |
| 16.10 yakkety | Ignored end of life |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-gke | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-goldfish | 17.04 zesty | Ignored end of life |
| 16.10 yakkety | Ignored end of life |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-grouper | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-hwe | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-hwe-edge | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-linaro-omap | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-linaro-shared | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-linaro-vexpress | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-lts-quantal | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-lts-raring | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-lts-saucy | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-lts-trusty | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not affected |
| linux-lts-utopic | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-lts-vivid | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-lts-wily | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-lts-xenial | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not affected |
| 12.04 LTS precise | Not in release |
| linux-maguro | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-mako | 17.04 zesty | Not in release |
| 16.10 yakkety | Ignored end of life |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-manta | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-qcm-msm | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |
| linux-raspi2 | 17.04 zesty | Not affected |
| 16.10 yakkety | Not affected |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-snapdragon | 17.04 zesty | Not affected |
| 16.10 yakkety | Not affected |
| 16.04 LTS xenial | Not affected |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Not in release |
| linux-ti-omap4 | 17.04 zesty | Not in release |
| 16.10 yakkety | Not in release |
| 16.04 LTS xenial | Not in release |
| 14.04 LTS trusty | Not in release |
| 12.04 LTS precise | Ignored end of life |

---

* [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)
* [What do statuses mean?](https://ubuntu.com/security/cves/about#statuses)
* [Patch details](https://ubuntu.com/security/CVE-2012-6704?format=md#patch-details)

## Notes

---

### [sbeattie](https://launchpad.net/~sbeattie)

it's not possible to exploit this via unprivileged
SO\_SNDBUF/SO\_RCVBUF setsockopt() calls, as passing a signed value that is
negative but when multiplied by 2 turns positive first gets compared
against the unsigned int sysctl\_wmem\_max value to see if its larger
than that. Because sysctl\_wmem\_max is unsigned, the compiler treats
the value passed as unsigned, and thus a "negative" value turns into
a large positive value, and runs afoul of this check.

### Patch details

For informational purposes only. We recommend not to cherry-pick updates. [How can I get the fixes?](https://ubuntu.com/security/cves/about#security)

| Package | Patch details |
| --- | --- |
| linux | * Introduced by   [1da177e](https://git.kernel.org/linus/1da177e4c3f41524e886b7f1b8a0c1fc7321cac2),   fixed by   [8298193](https://git.kernel.org/linus/82981930125abfd39d7c8378a9cfdf5e1be2002b) |

## Severity score breakdown

CVSS version:
CVSS v3.0

**Base score**

7.8 · High

* Base metrics

  | Parameter | Value |
  | --- | --- |
  | Attack vector | Local |
  | Attack complexity | Low |
  | Privileges required | Low |
  | User interaction | None |
  | Scope | Unchanged |
  | Confidentiality impact | High |
  | Integrity impact | High |
  | Availability impact | High |
* Scores

  | Parameter | Value |
  | --- | --- |
  | Base score | 7.8 · High |
  | Exploitability score | - |
  | Impact score | - |

**Vector:** CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

## References

* [MITRE](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6704)
* [NVD](https://nvd.nist.gov/vuln/detail/CVE-2012-6704)
* [Launchpad](https://launchpad.net/bugs/cve/CVE-2012-6704)
* [Debian](https://security-tracker.debian.org/tracker/CVE-2012-6704)

### Other references

* <http://www.openwall.com/lists/oss-security/2016/12/02>
* <https://www.cve.org/CVERecord?id=CVE-2012-6704>
