Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 512861 - (CVE-2009-2406) CVE-2009-2406 kernel: ecryptfs stack overflow in parse_tag_11_packet()
CVE-2009-2406 kernel: ecryptfs stack overflow in parse_tag_11_packet()
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
public=20090728,reported=20090721,sou...
: Security
Depends On: 512862 512863
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-20 21:15 EDT by Eugene Teo (Security Response)
Modified: 2014-10-17 04:44 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-21 13:03:43 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
[PATCH 1/2] eCryptfs: Check Tag 11 literal data buffer size (1.14 KB, patch)
2009-07-20 21:31 EDT, Eugene Teo (Security Response)
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:1193 normal SHIPPED_LIVE Important: kernel security and bug fix update 2009-08-04 09:15:15 EDT

  None (edit)
Description Eugene Teo (Security Response) 2009-07-20 21:15:41 EDT
Description of problem:
Ramon de Carvalho Valle was testing eCryptfs with fsfuzzer and ran across a stack overflow bug.  At the beginning of each eCryptfs file, metadata is stored containing things like encrypted file encryption key (EFEK), key signature of key used to decrypt the EFEK, etc.  This metadata is stored in "packets", as per RFC 2440 - OpenPGP Message Format.

The header of each packet contains a packet length field.  As the eCryptfs kernel module reads the packet contents, it uses that packet length field in a memcpy() to the destination buffer.  However, no checks existed to make sure the buffer was big enough to hold the entire packet contents.

A malicious user on the system that has permissions to perform an eCryptfs mount (root or setuid mount helper needed) can modify the metadata using hexedit and specify a bigger packet size than what the destination buffer can hold and also modify the packet contents, which would probably allow them to handcraft the data used to overwrite the stack.
Comment 1 Eugene Teo (Security Response) 2009-07-20 21:31:40 EDT
Created attachment 354415 [details]
[PATCH 1/2] eCryptfs: Check Tag 11 literal data buffer size
Comment 9 Eugene Teo (Security Response) 2009-07-28 22:01:53 EDT
Upstream commit:
http://git.kernel.org/linus/6352a29305373ae6196491e6d4669f301e26492e
Comment 10 Fedora Update System 2009-07-29 18:26:06 EDT
kernel-2.6.29.6-217.2.3.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/kernel-2.6.29.6-217.2.3.fc11
Comment 11 Vincent Danen 2009-07-31 15:35:42 EDT
Common Vulnerabilities and Exposures assigned an identifier CVE-2009-2406 to
the following vulnerability:

Name: CVE-2009-2406
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2406
Assigned: 20090709
Reference: BUGTRAQ:20090728 [RISE-2009002] Linux eCryptfs parse_tag_11_packet Literal Data Buffer Overflow Vulnerability
Reference: URL: http://www.securityfocus.com/archive/1/archive/1/505334/100/0/threaded
Reference: MISC: http://risesecurity.org/advisories/RISE-2009002.txt
Reference: CONFIRM: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6352a29305373ae6196491e6d4669f301e26492e
Reference: CONFIRM: http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.30.4
Reference: DEBIAN:DSA-1844
Reference: URL: http://www.debian.org/security/2009/dsa-1844
Reference: DEBIAN:DSA-1845
Reference: URL: http://www.debian.org/security/2009/dsa-1845
Reference: UBUNTU:USN-807-1
Reference: URL: http://www.ubuntu.com/usn/usn-807-1
Reference: BID:35851
Reference: URL: http://www.securityfocus.com/bid/35851
Reference: SECUNIA:35985
Reference: URL: http://secunia.com/advisories/35985
Reference: SECUNIA:36045
Reference: URL: http://secunia.com/advisories/36045
Reference: SECUNIA:36051
Reference: URL: http://secunia.com/advisories/36051
Reference: SECUNIA:36054
Reference: URL: http://secunia.com/advisories/36054
Reference: VUPEN:ADV-2009-2041
Reference: URL: http://www.vupen.com/english/advisories/2009/2041

Stack-based buffer overflow in the parse_tag_11_packet function in
fs/ecryptfs/keystore.c in the eCryptfs subsystem in the Linux kernel
before 2.6.30.4 allows local users to cause a denial of service
(system crash) or possibly gain privileges via vectors involving a
crafted eCryptfs file, related to not ensuring that the key signature
length in a Tag 11 packet is compatible with the key signature buffer
size.
Comment 12 Fedora Update System 2009-08-03 12:58:59 EDT
kernel-2.6.27.29-170.2.78.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/kernel-2.6.27.29-170.2.78.fc10
Comment 13 errata-xmlrpc 2009-08-04 09:15:38 EDT
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2009:1193 https://rhn.redhat.com/errata/RHSA-2009-1193.html
Comment 14 Fedora Update System 2009-08-04 20:30:18 EDT
kernel-2.6.27.29-170.2.78.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2009-08-04 20:35:43 EDT
kernel-2.6.29.6-217.2.3.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 19 Vincent Danen 2013-09-27 13:52:43 EDT
Acknowledgements:

Red Hat would like to thank Ramon de C. Valle for reporting this issue.

Note You need to log in before you can comment on or make changes to this bug.