]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] isofs: more defensive checks against corrupt isofs images
authorchrisw@osdl.org <chrisw@osdl.org>
Sat, 26 Mar 2005 01:46:03 +0000 (17:46 -0800)
committerGreg KH <gregkh@suse.de>
Thu, 12 May 2005 17:00:16 +0000 (10:00 -0700)
Michal Zalewski <lcamtuf@dione.ids.pl> discovers range checking flaws in
iso9660 filesystem.

http://marc.theaimsgroup.com/?l=bugtraq&m=111110067304783&w=2

CAN-2005-0815 is assigned to this issue.

Some more defensive checks to keep corrupt isofs images from corrupting
memory or causing Oops.

Signed-off-by: Chris Wright <chrisw@osdl.org>
===== fs/isofs/rock.c 1.23 vs edited =====

fs/isofs/rock.c

index 1c8d997d44a714ce8d4ea685a306faac33353f4b..8bdd3e409543bf0febb4fd837d323562c412eccb 100644 (file)
     offset1 = 0; \
     pbh = sb_bread(DEV->i_sb, block); \
     if(pbh){       \
+      if (offset > pbh->b_size || offset + cont_size > pbh->b_size){   \
+       brelse(pbh); \
+       goto out; \
+      } \
       memcpy(buffer + offset1, pbh->b_data + offset, cont_size - offset1); \
       brelse(pbh); \
       chr = (unsigned char *) buffer; \