xfs
[Top] [All Lists]

Re: [PATCH] xfs_repair: Check if agno is inside the filesystem

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs_repair: Check if agno is inside the filesystem
From: Lukas Czerner <lczerner@xxxxxxxxxx>
Date: Tue, 28 Jun 2011 11:24:46 +0200 (CEST)
Cc: Lukas Czerner <lczerner@xxxxxxxxxx>, xfs@xxxxxxxxxxx, aelder@xxxxxxx
In-reply-to: <20110628012838.GI32466@dastard>
References: <1309193610-17078-1-git-send-email-lczerner@xxxxxxxxxx> <20110628012838.GI32466@dastard>
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Tue, 28 Jun 2011, Dave Chinner wrote:

> On Mon, Jun 27, 2011 at 06:53:30PM +0200, Lukas Czerner wrote:
> > When getting an inode tree pointer from an array inode_tree_ptrs, we
> > should check if agno, which is used as a pointer to the array, lives
> > within the file system, because if it is not, we can end up touching
> > uninitialized memory.
> 
> How do you get an agno outside the bounds of the filesystem?

Hi Dave,

in my particular case the problem was in
longform_dir2_entry_check_data(). xfs_dir2_data_entry_t was read and we
used inode numbed (xfs_dir2_data_entry_t)->inumber to compute AG number.
However it contained garbage so the resulting agno was too high. In
modify mode it was not a problem, because the inode was cleared in the
earlies phase, but in no_modify mode, the was still there.

> 
> > This commit fixes it by passing xfs_mount_t to affected functions and
> > checking if agno really is inside the file system.
> 
> We're slowly removing typedefs as we change code. So probably better
> to use struct xfs_mount for all the places where you add an
> xfs_mount_t.

Will do. Thanks!
-Lukas

> 
> Otherwise seems fine.
> 
> Cheers,
> 
> Dave.
> 

-- 

<Prev in Thread] Current Thread [Next in Thread>