]> 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)
committerThomas Weißschuh <thomas@t-8ch.de>
Mon, 25 Sep 2023 22:31:10 +0000 (00:31 +0200)
commit0cf52fc4a03db3c59ad31bde4e9a28b5642086dc
tree6bcff4f90ece326b4c8c4bdc0217b1fb83baf611
parent87f491671efb920ddd1c45c70dc8016f072851bb
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]