Files
gcc/libiberty/testsuite
Ruslan Valiyev a8290fb163 libiberty: fix resource exhaustion in rust demangler (PR demangler/106641)
demangle_binder() parses the bound_lifetimes count as a base-62
integer with no upper bound.  A crafted symbol can encode a huge
lifetime count in very few bytes, causing OOM or CPU hang.

Cap bound_lifetimes at 1024 and check rdm->errored in the loop
so it bails out early on errors during iteration.

libiberty/ChangeLog:

	PR demangler/106641
	* rust-demangle.c (demangle_binder): Reject bound_lifetimes
	above 1024 to prevent resource exhaustion from crafted symbols.
	Add rdm->errored check in the loop condition.
	* testsuite/rust-demangle-expected: Add regression test.

Signed-off-by: Ruslan Valiyev <linuxoid@gmail.com>
2026-02-26 12:17:03 -08:00
..
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00
2026-01-02 09:56:11 +01:00