Bug 649695 (CVE-2010-3874)

Summary: CVE-2010-3874 kernel: CAN minor heap overflow
Product: [Other] Security Response Reporter: Eugene Teo (Security Response) <eteo>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: arozansk, bhu, davej, fhrbata, jkacur, kmcmartin, lgoncalv, lwang, pmatouse, tcallawa, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-28 08:47:05 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: 651845, 651846, 651847    
Bug Blocks:    

Description Eugene Teo (Security Response) 2010-11-04 10:25:12 UTC
Description of problem:
In bcm_connect() (in net/can/bcm.c), there is the following code:

	sprintf(bo->procname, "%p", sock);

"procname" is a 9-byte char array.  On 64-bit platforms, up to 17 bytes may be copied into the buffer. Fortunately, structure padding will most likely prevent this from being a problem, except for the trailing NULL byte, which may overwrite the first byte of the next heap object.

Reference:
http://www.spinics.net/lists/netdev/msg145791.html

Acknowledgements:

Red Hat would like to thank Dan Rosenberg for reporting this issue.

Comment 2 Petr Matousek 2010-11-10 12:49:51 UTC
Statement:

The Linux kernel as shipped with Red Hat Enterprise Linux 3, 4 and 5 did not include CAN bus subsystem support, and therefore are not affected by this issue. Future kernel updates in Red Hat Enterprise Linux 6 and Red Hat Enterprise MRG may address this flaw.

Comment 4 Eugene Teo (Security Response) 2010-11-12 07:08:08 UTC
Proposed patch:
http://www.spinics.net/lists/netdev/msg146469.html
http://www.spinics.net/lists/netdev/msg146270.html

Comment 5 Eugene Teo (Security Response) 2010-11-16 05:15:36 UTC
Upstream commit:
http://git.kernel.org/linus/0597d1b99fcfc2c0eada09a698f85ed413d4ba84

Comment 6 errata-xmlrpc 2010-12-08 19:09:30 UTC
This issue has been addressed in following products:

  MRG for RHEL-5

Via RHSA-2010:0958 https://rhn.redhat.com/errata/RHSA-2010-0958.html

Comment 7 Petr Matousek 2010-12-20 12:30:43 UTC
CAN BCM calls can_proto_register() that calls proto_register(cp->prot, 0) ie. it does not request to create per protocol slab cache with protocol defined object size. Because the sizeof(bcm_sock) is ~0x2d0 on x86_64 it falls into the kmalloc-1024 bucket leaving ~300 bytes as padding. Here off-by-one won't help much.

Comment 8 errata-xmlrpc 2011-01-11 19:45:19 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2011:0007 https://rhn.redhat.com/errata/RHSA-2011-0007.html