From bf58cd750e03f8738555f736218c95e5d47647a7 Mon Sep 17 00:00:00 2001 From: Adam Greenblatt Date: Fri, 25 Jul 2008 01:46:32 -0700 Subject: [PATCH] --- yaml --- r: 105856 b: refs/heads/master c: c0a1633b6201ef79e31b7da464d44fdf5953054d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/isofs/rock.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 36d64b9baa92..d86f6d0b7afe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 275c0a8f1253a7542ad9726956c918d8a1f694c4 +refs/heads/master: c0a1633b6201ef79e31b7da464d44fdf5953054d diff --git a/trunk/fs/isofs/rock.c b/trunk/fs/isofs/rock.c index 6bd48f0a7047..c2fb2dd0131f 100644 --- a/trunk/fs/isofs/rock.c +++ b/trunk/fs/isofs/rock.c @@ -209,6 +209,11 @@ int get_rock_ridge_filename(struct iso_directory_record *de, while (rs.len > 2) { /* There may be one byte for padding somewhere */ rr = (struct rock_ridge *)rs.chr; + /* + * Ignore rock ridge info if rr->len is out of range, but + * don't return -EIO because that would make the file + * invisible. + */ if (rr->len < 3) goto out; /* Something got screwed up here */ sig = isonum_721(rs.chr); @@ -216,8 +221,12 @@ int get_rock_ridge_filename(struct iso_directory_record *de, goto eio; rs.chr += rr->len; rs.len -= rr->len; + /* + * As above, just ignore the rock ridge info if rr->len + * is bogus. + */ if (rs.len < 0) - goto eio; /* corrupted isofs */ + goto out; /* Something got screwed up here */ switch (sig) { case SIG('R', 'R'): @@ -307,6 +316,11 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, repeat: while (rs.len > 2) { /* There may be one byte for padding somewhere */ rr = (struct rock_ridge *)rs.chr; + /* + * Ignore rock ridge info if rr->len is out of range, but + * don't return -EIO because that would make the file + * invisible. + */ if (rr->len < 3) goto out; /* Something got screwed up here */ sig = isonum_721(rs.chr); @@ -314,8 +328,12 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, goto eio; rs.chr += rr->len; rs.len -= rr->len; + /* + * As above, just ignore the rock ridge info if rr->len + * is bogus. + */ if (rs.len < 0) - goto eio; /* corrupted isofs */ + goto out; /* Something got screwed up here */ switch (sig) { #ifndef CONFIG_ZISOFS /* No flag for SF or ZF */