Flexible I/O Tester development
 help / color / mirror / Atom feed
* path name lengths
@ 2013-01-29  1:24 Ken Raeburn
  2013-01-29  1:48 ` [PATCH] Fix crash with absurdly but not impossibly deeply nested device stacks Ken Raeburn
  0 siblings, 1 reply; 10+ messages in thread
From: Ken Raeburn @ 2013-01-29  1:24 UTC (permalink / raw)
  To: fio

I was trying to set up a somewhat perverse test to look at the cost of
using LVMs on Linux, by stacking them many levels deep. When I ran fio,
it crashed before exiting, reporting memory corruption.

I've found a couple issues still present in today's git sources:

The path array in struct disk_util is only 256 bytes long, and there's
no check to avoid overflowing it, so if the string you try to put into
it is
"/sys/block/dm-47/slaves/../../dm-46/slaves/../../dm-45/slaves/../.."
(you get the idea), you can easily scribble past the end of the array,
and the containing disk_util structure.

I'll have a patch for this shortly.

In find_add_disk_slaves, where the code uses readlink on entries found
in the "slaves" subdirectory and appends to the previous directory name,
there is no check for exceeding the size of the automatic character
arrays. Since those arrays are 4KB I'm not having any problems with
them, but it might be good to add checks there.

Ken

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-01-30 21:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-29  1:24 path name lengths Ken Raeburn
2013-01-29  1:48 ` [PATCH] Fix crash with absurdly but not impossibly deeply nested device stacks Ken Raeburn
2013-01-29  9:17   ` Jens Axboe
2013-01-29  9:19     ` Jens Axboe
2013-01-29 21:06     ` Ken Raeburn
2013-01-29 21:15       ` Jens Axboe
2013-01-29 22:09         ` Ken Raeburn
2013-01-30 11:58           ` Jens Axboe
2013-01-30 21:25             ` [PATCH] Fix bugs in [v]snprintf usage Ken Raeburn
2013-01-30 21:48               ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox