Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 84076
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Sune Kloppenborg Jeppesen <jaervosz@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
libexif-0.5.12-buffer-overflow.patch Patch for the 0.5 branch from Fedora patch René Rhéaume (a.k.a. repzilon, rener) 2005-03-09 06:11 0000 860 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 84076 depends on: Show dependency tree
Bug 84076 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-03-04 04:54 0000
From Ubuntu bug:

The exif library fails to validate input in several place, and 
jpeg image with invalid exif data may crash user application.

------- Comment #1 From Thierry Carrez (RETIRED) 2005-03-08 02:50:40 0000 -------
Ubuntu patch over 0.6.9...

==============================================================
--- libexif-0.6.9/libexif/exif-data.c~	2005-03-03 22:54:52.333049248 +0100
+++ libexif-0.6.9/libexif/exif-data.c	2005-03-03 22:50:57.117807400 +0100
@@ -640,7 +640,7 @@
 #endif
 
 	/* Byte order (offset 6, length 2) */
-	if (ds < 12)
+	if (ds < 14)
 		return;
 	if (!memcmp (d + 6, "II", 2))
 		data->priv->order = EXIF_BYTE_ORDER_INTEL;
@@ -659,12 +659,18 @@
 	printf ("IFD 0 at %i.\n", (int) offset);
 #endif
 
+	if (ds < 6 + 4 + offset)
+		return;
+
 	/* Parse the actual exif data (offset 14) */
 	exif_data_load_data_content (data, data->ifd[EXIF_IFD_0], d + 6,
 				     ds - 6, offset);
 
 	/* IFD 1 offset */
 	n = exif_get_short (d + 6 + offset, data->priv->order);
+	if (ds < 6 + offset + 2 + 12 * n + 4)
+		return;
+
 	offset = exif_get_long (d + 6 + offset + 2 + 12 * n, data->priv->order);
 	if (offset) {
 #ifdef DEBUG
============================================================

This needs to be backported to 0.5, or the 0.6 branch needs to be unmasked and this patch applied. Backport looks easy, just a few variable names to change (fex "ds" was called "size").

Pulling eradicator in (as he was the one to mask it) for comments.
Pulling sekretarz in as he was the last committer.

Only the first hunk is not in upstream CVS yet. An equivalent of the second hunk is in CVS (exif-data.c v1.62) post 2.6.11.

------- Comment #2 From Jeremy Huddleston (RETIRED) 2005-03-09 04:04:28 0000 -------
I'd say unmask it and apply to 0.6.  Most major packages have been fixed to
support 0.6, but there may be a couple outliers that we missed...

------- Comment #3 From René Rhéaume (a.k.a. repzilon, rener) 2005-03-09 06:02:06 0000 -------
There is a patch for the 0.5 branch released by/for Fedora
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/3/SRPMS/libexif-0.5.12-3.1.src.rpm

I will extract the patch from the SRPM and attach it here.

------- Comment #4 From René Rhéaume (a.k.a. repzilon, rener) 2005-03-09 06:11:05 0000 -------
Created an attachment (id=53007) [details]
Patch for the 0.5 branch from Fedora

As Sune Kloppenborg Jeppesen reported, "size" in libexif 0.5.x became "ds" in
0.6.x . RedHat/Fedora Bugzilla bug 150506.

------- Comment #5 From Jeremy Huddleston (RETIRED) 2005-03-10 15:36:15 0000 -------
Archs: Please mark 0.5.12-r2 stable

------- Comment #6 From Markus Rothe 2005-03-10 22:10:59 0000 -------
stable on ppc64

------- Comment #7 From Lina Pezzella (RETIRED) 2005-03-11 20:13:24 0000 -------
Stable ppc-macos.

------- Comment #8 From Bryan Østergaard (RETIRED) 2005-03-11 20:30:10 0000 -------
Stable on alpha.

------- Comment #9 From Michael Hanselmann (hansmi) (RETIRED) 2005-03-12 00:39:28 0000 -------
Stable on ppc.

------- Comment #10 From Luke Macken (RETIRED) 2005-03-12 12:41:07 0000 -------
GLSA 200503-17

arm/hppa/ia64/mips, please mark stable to benefit from GLSA.

------- Comment #11 From Hardave Riar (RETIRED) 2005-03-12 23:47:51 0000 -------
Stable on mips.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug