From: Ken Raeburn <raeburn@permabit.com>
To: fio@vger.kernel.org
Subject: path name lengths
Date: Mon, 28 Jan 2013 20:24:12 -0500 [thread overview]
Message-ID: <6eham0rdc3.fsf@just-testing.permabit.com> (raw)
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
next reply other threads:[~2013-01-29 1:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 1:24 Ken Raeburn [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6eham0rdc3.fsf@just-testing.permabit.com \
--to=raeburn@permabit.com \
--cc=fio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox