Skip to content

Commit

Permalink
isofs: Fix unchecked printing of ER records
Browse files Browse the repository at this point in the history
commit 4e20246 upstream.

We didn't check length of rock ridge ER records before printing them.
Thus corrupted isofs image can cause us to access and print some memory
behind the buffer with obvious consequences.

Reported-and-tested-by: Carl Henrik Lunde <chlunde@ping.uio.no>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
jankara authored and gregkh committed Jan 8, 2015
1 parent e990e54 commit a3d4f59
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/isofs/rock.c
Expand Up @@ -362,6 +362,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
rs.cont_size = isonum_733(rr->u.CE.size);
break;
case SIG('E', 'R'):
/* Invalid length of ER tag id? */
if (rr->u.ER.len_id + offsetof(struct rock_ridge, u.ER.data) > rr->len)
goto out;
ISOFS_SB(inode->i_sb)->s_rock = 1;
printk(KERN_DEBUG "ISO 9660 Extensions: ");
{
Expand Down

0 comments on commit a3d4f59

Please sign in to comment.