]> git.ipfire.org Git - thirdparty/util-linux.git/commit
fsck.cramfs: Fix bus error on broken file system.
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 30 Oct 2017 12:49:53 +0000 (13:49 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 2 Nov 2017 12:56:14 +0000 (13:56 +0100)
commit7cb962c77015e9383b53eeb22ce732cb5216bbc3
tree106a8667441779e354cddae0ab388af167b83705
parent8175ed3d74adacc895657ded7546cb3c5deeabad
fsck.cramfs: Fix bus error on broken file system.

The utility fsck.cramfs is prone to a bus error on file systems for
big endian systems with non-standard header sizes. While calculating
the crc32 checksum, it does not properly handle a possible offset
for bootcodes, resulting in out of boundary access of mmap'ed area.

You can trigger the issue with the following commands:

$ mkdir -p cramfs-poc/root/subdir
$ cd cramfs-poc
$ mkfs.cramfs -p -N big root cramfs
$ echo -ne \\00\\x4c | dd of=cramfs bs=1 seek=518 count=2 conv=notrunc
$ fsck.cramfs cramfs

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
disk-utils/fsck.cramfs.c