Re: [Patch] Fix Buffer overflow in hfsplus with a corrupted image

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pekka Enberg <penberg@...>
Cc: <zippel@...>, <linux-kernel@...>
Date: Sunday, August 24, 2008 - 11:24 am

* Pekka Enberg (penberg@cs.helsinki.fi) wrote:

Ah, i missed that the name array is __be16, i somehow assumed it was a
char array, and tried to account for the multiplication by 2 in 
hfsplus_cat_build_key_uni(). here is an updated fix.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux/fs/hfsplus/catalog.c.orig	2008-08-24 14:52:03.000000000 +0200
+++ linux/fs/hfsplus/catalog.c	2008-08-24 14:54:15.000000000 +0200
@@ -168,6 +168,11 @@ int hfsplus_find_cat(struct super_block 
 		return -EIO;
 	}
 
+	if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
+		printk(KERN_ERR "hfs: catalog name length corrupted\n");
+		return -EIO;
+	}
+
 	hfsplus_cat_build_key_uni(fd->search_key, be32_to_cpu(tmp.thread.parentID),
 				 &tmp.thread.nodeName);
 	return hfs_brec_find(fd);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Patch] Fix Buffer overflow in hfsplus with a corrupted ..., Eric Sesterhenn, (Sun Aug 24, 11:24 am)