[kernel] r14040 - in dists/lenny-security/linux-2.6/debian: . patches/bugfix/all patches/series

Dann Frazier dannf at alioth.debian.org
Wed Jul 29 00:02:42 UTC 2009


Author: dannf
Date: Wed Jul 29 00:01:37 2009
New Revision: 14040

Log:
* ecryptfs: Check Tag 11 literal data buffer size (CVE-2009-2406)
* ecryptfs: check tag 3 package encrypted size (CVE-2009-2407)

Added:
   dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-check-tag-11-literal-data-buffer-size.patch
   dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-parse_tag_3_packet-check-tag-3-package-encrypted-key-size.patch
Modified:
   dists/lenny-security/linux-2.6/debian/changelog
   dists/lenny-security/linux-2.6/debian/patches/series/17lenny1

Modified: dists/lenny-security/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny-security/linux-2.6/debian/changelog	Tue Jul 28 23:54:09 2009	(r14039)
+++ dists/lenny-security/linux-2.6/debian/changelog	Wed Jul 29 00:01:37 2009	(r14040)
@@ -1,10 +1,12 @@
-linux-2.6 (2.6.26-17lenny1) UNRELEASED; urgency=high
+linux-2.6 (2.6.26-17lenny1) stable-security; urgency=high
 
   * [KVM] x86: check for cr3 validity in ioctl_set_sregs
     (CVE-2009-2287)
   * personality: fix PER_CLEAR_ON_SETID (CVE-2009-1895)
+  * ecryptfs: Check Tag 11 literal data buffer size (CVE-2009-2406)
+  * ecryptfs: check tag 3 package encrypted size (CVE-2009-2407)
 
- -- dann frazier <dannf at debian.org>  Sun, 05 Jul 2009 22:57:23 -0600
+ -- dann frazier <dannf at debian.org>  Sat, 25 Jul 2009 15:10:10 -0600
 
 linux-2.6 (2.6.26-17) stable; urgency=high
 

Added: dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-check-tag-11-literal-data-buffer-size.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-check-tag-11-literal-data-buffer-size.patch	Wed Jul 29 00:01:37 2009	(r14040)
@@ -0,0 +1,40 @@
+Tag 11 packets are stored in the metadata section of an eCryptfs file to
+store the key signature(s) used to encrypt the file encryption key.
+After extracting the packet length field to determine the key signature
+length, a check is not performed to see if the length would exceed the
+key signature buffer size that was passed into parse_tag_11_packet().
+
+Thanks to Ramon de Carvalho Valle for finding this bug using fsfuzzer.
+
+Signed-off-by: Tyler Hicks <tyhicks at linux.vnet.ibm.com>
+---
+ fs/ecryptfs/keystore.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+Adjusted to apply to Debian's 2.6.26 by dann frazier <dannf at debian.org
+
+diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
+index af737bb..5414253 100644
+--- a/fs/ecryptfs/keystore.c
++++ b/fs/ecryptfs/keystore.c
+@@ -1449,6 +1449,12 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
+ 		rc = -EINVAL;
+ 		goto out;
+ 	}
++	if (unlikely((*tag_11_contents_size) > max_contents_bytes)) {
++		printk(KERN_ERR "Literal data section in tag 11 packet exceeds "
++		       "expected size\n");
++		rc = -EINVAL;
++		goto out;
++	}
+ 	if (data[(*packet_size)++] != 0x62) {
+ 		printk(KERN_WARNING "Unrecognizable packet\n");
+ 		rc = -EINVAL;
+-- 
+1.6.2.5
+
+_______________________________________________
+Vendor Security mailing list
+Vendor Security at lst.de
+https://www.lst.de/cgi-bin/mailman/listinfo/vendor-sec
+

Added: dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-parse_tag_3_packet-check-tag-3-package-encrypted-key-size.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny-security/linux-2.6/debian/patches/bugfix/all/ecryptfs-parse_tag_3_packet-check-tag-3-package-encrypted-key-size.patch	Wed Jul 29 00:01:37 2009	(r14040)
@@ -0,0 +1,28 @@
+The parse_tag_3_packet function does not check if the tag 3 packet contains a
+encrypted key size larger than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES.
+
+Signed-off-by: Ramon de Carvalho Valle <ramon at risesecurity.org>
+Signed-off-by: Tyler Hicks <tyhicks at linux.vnet.ibm.com>
+---
+ fs/ecryptfs/keystore.c |    7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+Adjusted to apply to Debian's 2.6.26 by dann frazier <dannf at debian.org>
+
+diff -urpN linux-source-2.6.26.orig/fs/ecryptfs/keystore.c linux-source-2.6.26/fs/ecryptfs/keystore.c
+--- linux-source-2.6.26.orig/fs/ecryptfs/keystore.c	2009-07-25 15:02:53.000000000 -0600
++++ linux-source-2.6.26/fs/ecryptfs/keystore.c	2009-07-25 15:05:01.000000000 -0600
+@@ -730,6 +730,13 @@ parse_tag_3_packet(struct ecryptfs_crypt
+ 	}
+ 	(*new_auth_tok)->session_key.encrypted_key_size =
+ 		(body_size - (ECRYPTFS_SALT_SIZE + 5));
++	if ((*new_auth_tok)->session_key.encrypted_key_size
++	    > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) {
++		printk(KERN_WARNING "Tag 3 packet contains key larger "
++		       "than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES\n");
++		rc = -EINVAL;
++		goto out_free;
++	}
+ 	if (unlikely(data[(*packet_size)++] != 0x04)) {
+ 		printk(KERN_WARNING "Unknown version number [%d]\n",
+ 		       data[(*packet_size) - 1]);

Modified: dists/lenny-security/linux-2.6/debian/patches/series/17lenny1
==============================================================================
--- dists/lenny-security/linux-2.6/debian/patches/series/17lenny1	Tue Jul 28 23:54:09 2009	(r14039)
+++ dists/lenny-security/linux-2.6/debian/patches/series/17lenny1	Wed Jul 29 00:01:37 2009	(r14040)
@@ -1,2 +1,4 @@
 + bugfix/x86/kvm-check-for-cr3-validity-in-ioctl_set_sregs.patch
 + bugfix/all/personality-fix-PER_CLEAR_ON_SETID.patch
++ bugfix/all/ecryptfs-check-tag-11-literal-data-buffer-size.patch
++ bugfix/all/ecryptfs-parse_tag_3_packet-check-tag-3-package-encrypted-key-size.patch



More information about the Kernel-svn-changes mailing list