]> git.dujemihanovic.xyz Git - u-boot.git/commit
squashfs: Fix integer overflow in sqfs_inode_size()
authorRichard Weinberger <richard@nod.at>
Fri, 2 Aug 2024 16:36:45 +0000 (18:36 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 15 Aug 2024 22:14:36 +0000 (16:14 -0600)
commitc8e929e5758999933f9e905049ef2bf3fe6b140d
tree58747ceff98fb274c86f85454f04db1304364371
parent233945eba63e24061dffeeaeb7cd6fe985278356
squashfs: Fix integer overflow in sqfs_inode_size()

A carefully crafted squashfs filesystem can exhibit an extremly large
inode size and overflow the calculation in sqfs_inode_size().
As a consequence, the squashfs driver will read from wrong locations.

Fix by using __builtin_add_overflow() to detect the overflow.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
fs/squashfs/sqfs_inode.c