Bug 440706 - (CVE-2008-1420) CVE-2008-1420 vorbis: integer overflow in partvals computation
CVE-2008-1420 vorbis: integer overflow in partvals computation
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
source=vendorsec,reported=20080318,pu...
: Security
Depends On: 444703 444704 444705 444706 444707 444708 446341 446342 446343 446344 833929
Blocks: 438125
  Show dependency treegraph
 
Reported: 2008-04-04 11:22 EDT by Tomas Hoger
Modified: 2016-03-04 07:37 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-19 06:47:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Tomas Hoger 2008-04-04 11:22:34 EDT
Will Drewry of the Google Security Team reported an issue in OGG Vorbis library,
that can cause an integer overflow leading to possible heap overflow.
Comment 3 Tomas Hoger 2008-04-04 11:45:21 EDT
Upstream patch:

$ svn log -r 14598 http://svn.xiph.org/trunk/vorbis/
------------------------------------------------------------------------
r14598 | xiphmont | 2008-03-18 16:39:43 +0100 (Tue, 18 Mar 2008) | 6 lines

Add code to prevent heap attacks by exploiting dim=bignum and
partition_codewords = partion_values^dim.  partition_codewords is
actually overdetermined; in the case of inconsistency, mark stream
undecodable.

------------------------------------------------------------------------

$ svn diff -r 14597:14600 http://svn.xiph.org/trunk/vorbis/lib
Index: misc.h
===================================================================
--- misc.h      (revision 14597)
+++ misc.h      (revision 14600)
@@ -29,6 +29,7 @@
 #ifdef DEBUG_MALLOC

 #define _VDBG_GRAPHFILE "malloc.m"
+#undef _VDBG_GRAPHFILE
 extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
 extern void _VDBG_free(void *ptr,char *file,long line);

Index: res0.c
===================================================================
--- res0.c      (revision 14597)
+++ res0.c      (revision 14600)
@@ -223,6 +223,20 @@
   for(j=0;j<acc;j++)
     if(info->booklist[j]>=ci->books)goto errout;

+  /* verify the phrasebook is not specifying an impossible or
+     inconsistent partitioning scheme. */
+  {
+    int entries = ci->book_param[info->groupbook]->entries;
+    int dim = ci->book_param[info->groupbook]->dim;
+    int partvals = 1;
+    while(dim>0){
+      partvals *= info->partitions;
+      if(partvals > entries) goto errout;
+      dim--;
+    }
+    if(partvals != entries) goto errout;
+  }
+
   return(info);
  errout:
   res0_free_info(info);
@@ -263,7 +277,7 @@
     }
   }

-  look->partvals=rint(pow((float)look->parts,(float)dim));
+  look->partvals=look->phrasebook->entries;
   look->stages=maxstage;
   look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
   for(j=0;j<look->partvals;j++){
Index: misc.c
===================================================================
--- misc.c      (revision 14597)
+++ misc.c      (revision 14600)
@@ -190,7 +190,10 @@
   pthread_mutex_unlock(&memlock);
 }

-extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
+void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
+  if(bytes<=0)
+    fprintf(stderr,"bad malloc request (%ld bytes) from %s:%ld\n",bytes,file,line);
+
   bytes+=HEAD_ALIGN;
   if(ptr){
     ptr-=HEAD_ALIGN;
@@ -203,7 +206,7 @@
   return _insert(ptr,bytes,file,line);
 }

-extern void _VDBG_free(void *ptr,char *file,long line){
+void _VDBG_free(void *ptr,char *file,long line){
   if(ptr){
     ptr-=HEAD_ALIGN;
     _ripremove(ptr);
Comment 8 Tomas Hoger 2008-05-14 03:30:40 EDT
Lifting embargo.
Comment 10 Fedora Update System 2008-05-14 06:47:55 EDT
libvorbis-1.2.0-4.fc9 has been submitted as an update for Fedora 9
Comment 11 Fedora Update System 2008-05-14 06:50:13 EDT
libvorbis-1.2.0-2.fc8 has been submitted as an update for Fedora 8
Comment 12 Fedora Update System 2008-05-14 06:51:49 EDT
libvorbis-1.1.2-4.fc7 has been submitted as an update for Fedora 7
Comment 13 Fedora Update System 2008-05-14 18:08:00 EDT
libvorbis-1.2.0-2.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 14 Fedora Update System 2008-05-14 18:08:44 EDT
libvorbis-1.1.2-4.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 15 Fedora Update System 2008-05-14 18:10:02 EDT
libvorbis-1.2.0-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

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