Bug 228722

Summary: [RHEL4] [patch] cid-10 Add missing NULL check to e2fsck_get_dir_info()
Product: Red Hat Enterprise Linux 4 Reporter: Bryn M. Reeves <bmr>
Component: e2fsprogsAssignee: Eric Sandeen <esandeen>
Status: CLOSED ERRATA QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: sct, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0758 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 16:01:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 234251, 239341    
Attachments:
Description Flags
e2fsck - check return value of e2fsck_get_dir_info() none

Description Bryn M. Reeves 2007-02-14 17:02:18 UTC
Description of problem:
e2fsck calls e2fsck_get_dir_info() to retrieve directory information, but it is
possible that e2fsck_get_dir_info() returns a NULL pointer. We do not want to
blow up when dereferencing p.  It seems to be more sane/safe to call
fix_problem(ctx, PR_3_NO_DIRINFO, pctx) if p is NULL at this point since we do
not have any DIRINFO for pctx->ino.

Version-Release number of selected component (if applicable):
e2fsprogs-1.35-12.4.EL4

How reproducible:
Difficult - currently don't have a way to trigger this one easily, but the flaw
is fairly obvious. 
  
Actual results:
e2fsck may dereference a NULL pointer.

Expected results:
e2fsck checks return value and avoids dereferencing a NULL.

Comment 1 Bryn M. Reeves 2007-02-14 17:02:19 UTC
Created attachment 148068 [details]
e2fsck - check return value of e2fsck_get_dir_info()

Comment 4 Eric Sandeen 2007-05-29 20:33:10 UTC
upstream commit http://thunk.org/hg/e2fsprogs/?rev/dcaef25d7a55

Comment 6 Benjamin Kahn 2007-06-08 14:37:47 UTC
Applying a DEV_ACK for Eric Sandeen <sandeen>.  This bug
    was found by coverity and has a patch available.

Comment 8 Eric Sandeen 2007-07-02 20:43:47 UTC
In cvs as of e2fsprogs-1.35-12.7.el4

Comment 12 errata-xmlrpc 2007-11-15 16:01:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0758.html