]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mkfs.minix: check requested blocks will not exceed available on device
authorSami Kerola <kerolasa@iki.fi>
Wed, 24 Jun 2015 08:15:14 +0000 (09:15 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 30 Jul 2015 09:39:15 +0000 (11:39 +0200)
commita232cfdc0a3d40239e0f0a3bbfda0a9a92c880b6
tree0c6e2121b61841bbd78329209f76dc7404e211c1
parent2159dbf365e47d7db9961c1aec95549be75c5759
mkfs.minix: check requested blocks will not exceed available on device

Earlier user could define more blocks than device, or backing file for
loopback file system, had available.  That lead to a system crash with
following commands;

fallocate --length 64KiB test-file
mkfs.minix -3 -i 842160 test-file 104882174
mkdir test-file.d
mount test-file test-file.d
cp /etc/service test-file.d
Killed
sudo umount test-file.d

The minix driver should probably not hang the whole kernel, but the least
that mkfs.minix ought to do is not to let users to get that condition
quite as easily.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/mkfs.minix.c