Bug 1317383 (CVE-2016-3134)

Summary: CVE-2016-3134 kernel: netfilter: missing bounds check in ipt_entry structure
Product: [Other] Security Response Reporter: Andrej Nemec <anemec>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: aquini, arm-mgr, bhu, carnil, dhoward, fhrbata, fwestpha, gansalmon, iboverma, itamar, jforbes, jkacur, joelsmith, jonathan, jross, jwboyer, kernel-maint, kernel-mgr, kstutsma, lgoncalv, madhu.chinakonda, matt, mchehab, mcressma, nmurray, plougher, pmatouse, ppandit, rt-maint, rvrbovsk, slawomir, vdronov, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A security flaw was found in the Linux kernel in the mark_source_chains() function in "net/ipv4/netfilter/ip_tables.c". It is possible for a user-supplied "ipt_entry" structure to have a large "next_offset" field. This field is not bounds checked prior to writing to a counter value at the supplied offset.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 02:49:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1317384, 1318693, 1318694, 1318695, 1318696, 1364809, 1364810    
Bug Blocks: 1317388, 1320141    

Description Andrej Nemec 2016-03-14 07:43:31 UTC
In the mark_source_chains function (net/ipv4/netfilter/ip_tables.c) it is possible for a user-supplied ipt_entry structure to have a large next_offset field. This field is not bounds checked prior to writing a counter value at the supplied offset.

Proposed fix:

patch v1 message: http://marc.info/?l=netfilter-devel&m=145757134822741&w=2
patch v2  thread: http://marc.info/?t=145757149500006&r=1&w=2

patch v2 message: http://marc.info/?l=netfilter-devel&m=145762719008418&w=2
patch v2  thread: (none yet) http://marc.info/?l=netfilter-devel&r=4&b=201603&w=2

CVE request and assignment:

http://seclists.org/oss-sec/2016/q1/581
http://seclists.org/oss-sec/2016/q1/619

Audit done by netfilter team found several related bugs, patches to better validate rulesets are currently queued in pablos nf-next tree upstream (use "parent" link to cycle to next one - there are 17 additional patches):

https://git.kernel.org/cgit/linux/kernel/git/pablo/nf-next.git/commit/?id=d7591f0c41ce3e67600a982bab6989ef0f07b3ce

Comment 1 Andrej Nemec 2016-03-14 07:44:13 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1317384]

Comment 4 Vladis Dronov 2016-03-17 13:43:07 UTC
Statement:

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 5, 6. This issue is not currently planned to be addressed in future updates, as user namespaces which the flaw affects are not supported in these products. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 7 and MRG-2. Future Linux kernel updates for the respective releases might address this issue.

Comment 9 Petr Matousek 2016-03-22 12:46:30 UTC
*** Bug 1320138 has been marked as a duplicate of this bug. ***

Comment 10 Fedora Update System 2016-03-23 22:25:14 UTC
kernel-4.4.6-300.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2016-03-24 00:00:01 UTC
kernel-4.4.6-200.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-04-02 00:41:48 UTC
kernel-4.5.0-302.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-04-02 15:49:30 UTC
kernel-4.5.0-302.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Florian Westphal 2016-07-04 11:26:14 UTC
I'd prefer if the maintainers of those trees can take care of picking these patches up since I don't know how to do this.

All changes are now in rhel7.git .  I only see a problem with older
rhel7 kernels (where netfilter rule blob is percpu), if 7.1 and 7.2 releases need a zstream please let me know.

If there are any other questions feel free to ping me.

Comment 21 errata-xmlrpc 2016-09-14 23:42:27 UTC
This issue has been addressed in the following products:

  MRG for RHEL-6 v.2

Via RHSA-2016:1883 https://rhn.redhat.com/errata/RHSA-2016-1883.html

Comment 22 errata-xmlrpc 2016-09-15 08:01:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:1847 https://rhn.redhat.com/errata/RHSA-2016-1847.html

Comment 23 errata-xmlrpc 2016-09-15 08:10:49 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2016:1875 https://rhn.redhat.com/errata/RHSA-2016-1875.html