cluster/gfs2/fsck metawalk.c
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: rpeterso at sourceware.org 2007-01-23 19:54:23
Modified files:
gfs2/fsck : metawalk.c
Log message:
Resolves: bz 223843 GFS2: gfs2_fsck segfaulting on corrupt extended attributes
gfs2/fsck/metawalk.c +5 -4
@@ -227,7 +227,7 @@* compare it against leaf->lf_entries */ break ; }else { -brelse (lbh, *updated); +brelse (lbh, *update);if (!leaf.lf_next)break ; leaf_no = leaf.lf_next;
@@ -247,6 +247,7 @@uint64_t *ea_data_ptr =NULL ;int i;int error =0 ; +uint32_t offset = (uint32_t )sizeof (struct gfs2_meta_header );if (!pass->check_eattr_entry) {return 0 ;
@@ -287,11 +288,11 @@ } } } -if (ea_hdr->ea_flags &GFS2_EAFLAG_LAST ){ -/* FIXME: better equal the end of the block */ + offset +=be32_to_cpu (ea_hdr->ea_rec_len); +if (ea_hdr->ea_flags &GFS2_EAFLAG_LAST || + offset >= ip->i_sbd->sd_sb.sb_bsize || ea_hdr->ea_rec_len ==0 ){break ; } -/* FIXME: be sure this doesn't go beyond the end */ ea_hdr_prev = ea_hdr; ea_hdr = (struct gfs2_ea_header *) ((char *)(ea_hdr) +