]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: (ntfs) validate that sector_size is a power of two
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 25 Sep 2023 22:27:22 +0000 (00:27 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Nov 2023 09:50:19 +0000 (10:50 +0100)
commit7e5056f33bdfd867ce6f1a642f560fdf0b402c1e
tree0b4f8f140f108ff140dce5ab492c266fdf824787
parentf368ccc759f9684338da723a93449764d0a8e312
libblkid: (ntfs) validate that sector_size is a power of two

The NTFS prober reads data based off an offset of the sector size.
If the sector size is unaligned and the read data is cached then other
probers can read unaligned values.

Sector sizes for NTFS actually only make sense as power-of-two so
validate that and as a sideeffect avoid the unaligned reads.

Also add the reproducer from OSS-Fuzz that found this issue.

Fixes #2509

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libblkid/src/superblocks/ntfs.c
tests/ts/fuzzers/test_blkid_fuzz_files/oss-fuzz-62691 [new file with mode: 0644]