[PATCH] squashfs: Fix stack overflow while symlink resolving
authorRichard Weinberger <richard@nod.at>
Fri, 2 Aug 2024 16:36:47 +0000 (18:36 +0200)
committerDaniel Leidert <dleidert@debian.org>
Sun, 29 Jun 2025 00:33:57 +0000 (02:33 +0200)
commit321897e62da4ec4bd738ac9b610565da414bbedb
treeb104cfa3d7a225e79d4a54c03729fde9f7541f70
parent4c2aa75d33292a975b559d6acfeddd21086dd4a3
[PATCH] squashfs: Fix stack overflow while symlink resolving

The squashfs driver blindly follows symlinks, and calls sqfs_size()
recursively. So an attacker can create a crafted filesystem and with
a deep enough nesting level a stack overflow can be achieved.

Fix by limiting the nesting level to 8.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-By: Daniel Leidert <dleidert@debian.org>
Origin: https://source.denx.de/u-boot/u-boot/-/commit/4f5cc096bfd0a591f8a11e86999e3d90a9484c34
Bug: https://www.openwall.com/lists/oss-security/2025/02/17/2
Bug-Debian: https://bugs.debian.org/1098254
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2024-57257
Bug-Freexian-Security: https://deb.freexian.com/extended-lts/tracker/CVE-2024-57257

Gbp-Pq: Name CVE-2024-57257.patch
fs/squashfs/sqfs.c