[PATCH V2] xfsprogs: Fix possible unallocated memory access in fiemap

Mark Tinguely tinguely at sgi.com
Thu Feb 21 09:28:08 CST 2013


On 01/25/13 15:10, Eric Sandeen wrote:
> (Based on original patch by Lukas Czerner&  comments by Dave Chinner)
>
> Currently we could access unallocated memory in fiemap because we're
> using uninitialized variable 'fiemap' in fiemap_f(). In fact this has
> been spotted on x390s machine where xfs_io would segfault.
>
> The problem happens in the for cycle which seems to be intended to
> compute the header item spacing. However at that point the fiemap
> structure has just been allocated and does not contain any extents
> yet, so it is entirely useless and it never actually worked.
>
> This patch delays the format calculation until the first batch
> of extents has come in for analysis.
>
> Signed-off-by: Eric Sandeen<sandeen at redhat.com>
> ---

A working calculated format is a great improvement.

Reviewed-by: Mark Tinguely <tinguely at sgi.com>



More information about the xfs mailing list