Skip to contentSkip to conversation

xfsprogs: Fix possible unallocated memory access in fiemap

PATCH Mark Tinguely 1 participant 1 message Feb 21, 2013 5 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20121212231245.GY16353@dastard

A message that is not in the archive (sent off-list or not yet received): alpine.LFD.2.00.1212131024460.17970@localhost

A message that is not in the archive (sent off-list or not yet received): 20121213230608.GI16353@dastard

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mark Tinguely

author Reviewed-by
#5 lore raw
Quoted 11 lines · Eric Sandeen

(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.

Quoted 5 lines

This patch delays the format calculation until the first batch of extents has come in for analysis.

---

A working calculated format is a great improvement.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs