Bug 1243852 (CVE-2015-5156)

Summary: CVE-2015-5156 kernel: buffer overflow with fraglist larger than MAX_SKB_FRAGS + 2 in virtio-net
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: agordeev, aquini, bhu, carnil, dhoward, esammons, fhrbata, iboverma, jkacur, joelsmith, jross, kernel-mgr, lgoncalv, lwang, matt, mcressma, mguzik, mleitner, mst, nmurray, pholasek, plougher, pmatouse, rvrbovsk, security-response-team, williams, wmealing
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A buffer overflow flaw was found in the way the Linux kernel's virtio-net subsystem handled certain fraglists when the GRO (Generic Receive Offload) functionality was enabled in a bridged network configuration. An attacker on the local network could potentially use this flaw to crash the system, or, although unlikely, elevate their privileges on the system.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 07:28:29 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: 1245995, 1245996, 1247839, 1247840, 1247841, 1247844, 1266515    
Bug Blocks: 1243854    

Description Vasyl Kaigorodov 2015-07-16 13:14:25 UTC
When a guests KVM network devices is in a bridge configuration the kernel can create a situation in which packets are fragmented in an unexpected fashion. The GRO functionality can create a situation in which multiple SKB's are chained together
in a single packets fraglist (by design).  

The virtio module declares support for NETIF_F_FRAGLIST and assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist, when GRO is enabled on the incoming driver it can create more fragments than expected.

A longer than expected fragment list in the socket buffer will make the call to skb_to_sgvec overflow the sg array, leading to memory corruption.  It is unlikely that an attacker can use this as controlled memory corruption to execute arbitrary code.

Upstream patch: 
http://marc.info/?l=linux-netdev&m=143868216724068&w=2

References:
http://www.openwall.com/lists/oss-security/2015/08/06/1

Acknowledgements:

This issue was discovered by Jason Wang of Red Hat.

Comment 4 Wade Mealing 2015-07-29 04:27:30 UTC
Statement:

This issue did not affect the Linux kernel packages as shipped with Red Hat Enterprise MRG 2.

This issue affects the Linux kernel packages as shipped with Red Hat Enterprise Linux 5. Red Hat Enterprise Linux 5 is now in Production 3 Phase of the support and maintenance life cycle. This has been rated as having Moderate security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.

Comment 7 Petr Matousek 2015-09-25 13:19:15 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 1266515]

Comment 8 Fedora Update System 2015-10-16 06:57:29 UTC
kernel-4.2.3-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 9 errata-xmlrpc 2015-11-03 16:43:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2015:1977 https://rhn.redhat.com/errata/RHSA-2015-1977.html

Comment 11 Fedora Update System 2015-11-13 02:50:48 UTC
kernel-4.1.12-101.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 errata-xmlrpc 2016-05-10 22:52:09 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

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