Squashfs: avoid out of bounds writes in decompressors
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 2 lines · On Thu, 4 Feb 2021 13:02:46 +0000 Phillip Lougher <[email protected]>…
This is a regression introduced by the patch "migrate from
ll_rw_blockusage to BIO".
Quoted 9 lines
Sysbot/Syskaller has reported a number of "out of bounds writes" and "unable to handle kernel paging request in
squashfs_decompress" errors which have been identified as a regression introduced by the above patch.Specifically, the patch removed the following sanity check
if (length < 0 || length >
output->length||(index + length) > msblk->bytes_used)
Quoted 8 lines
This check did two things:
1. It ensured any reads were not beyond the end of the filesystem
2. It ensured that the "length" field read from the filesystem was within the expected maximum length. Without this any corrupted values can over-run allocated buffers.
All sounds fairly serious. Should I add a cc:stable to this?