diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-06-24 11:15:33 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2010-06-24 11:15:33 +1000 |
commit | 7124fe0a5b619d65b739477b3b55a20bf805b06d (patch) | |
tree | be333ebdcc7df735070dbc1441c1d59682d06132 /fs/binfmt_aout.c | |
parent | 7dce11dbac54fce777eea0f5fb25b2694ccd7900 (diff) |
xfs: validate untrusted inode numbers during lookup
When we decode a handle or do a bulkstat lookup, we are using an
inode number we cannot trust to be valid. If we are deleting inode
chunks from disk (default noikeep mode), then we cannot trust the on
disk inode buffer for any given inode number to correctly reflect
whether the inode has been unlinked as the di_mode nor the
generation number may have been updated on disk.
This is due to the fact that when we delete an inode chunk, we do
not write the clusters back to disk when they are removed - instead
we mark them stale to avoid them being written back potentially over
the top of something that has been subsequently allocated at that
location. The result is that we can have locations of disk that look
like they contain valid inodes but in reality do not. Hence we
cannot simply convert the inode number to a block number and read
the location from disk to determine if the inode is valid or not.
As a result, and XFS_IGET_BULKSTAT lookup needs to actually look the
inode up in the inode allocation btree to determine if the inode
number is valid or not.
It should be noted even on ikeep filesystems, there is the
possibility that blocks on disk may look like valid inode clusters.
e.g. if there are filesystem images hosted on the filesystem. Hence
even for ikeep filesystems we really need to validate that the inode
number is valid before issuing the inode buffer read.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/binfmt_aout.c')
0 files changed, 0 insertions, 0 deletions