fs/squashfs: fix potential integer overflows
authorJoao Marcos Costa <joaomarcos.costa@bootlin.com>
Wed, 19 Feb 2025 10:16:33 +0000 (11:16 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 24 Feb 2025 14:49:04 +0000 (08:49 -0600)
commit59fd62d71c6a04b3ab9db848414a7c386cfd2cfb
treee30a0d341111f0eb8cae3dd52c2f18ca02bfd2a7
parent5061eab96acd60d28149e080f3a37fbe7220ca54
fs/squashfs: fix potential integer overflows

The length of buffers used to read inode tables, directory tables, and
reading a file are calculated as: number of blocks * block size, and
such plain multiplication is prone to overflowing (thus unsafe).

Replace it by __builtin_mul_overflow, i.e. safe math.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
fs/squashfs/sqfs.c