GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/ia64

Fix IA64 unwinder register copy to use byte counts.

The IA64 unwinder's register copy function now correctly uses byte counts, fixing a bug that could overwrite stack data or cause faults.

A bug in the IA64 unwinder’s ia64_copy_rbs function caused it to copy eight times the intended amount of data when handling alternate signal stacks. This was because the function expected a length in 8-byte words, but the kernel and Linux callers provided a length in bytes. This incorrect copying could lead to overwriting live stack data or causing faults. This commit modifies ia64_copy_rbs to accept its length in bytes, resolving the issue.

In Details

When a signal handler runs on an alternate stack in IA64, the unwinder needs to copy the register backing store (RBS) from the handler's stack to the interrupted thread's stack. The kernel provides the size of this region in bytes, but ia64_copy_rbs (and ia64_vms_fallback_frame_state) expected the size in 8-byte words. This discrepancy caused an overflow during the copy, potentially corrupting the interrupted thread's stack. By changing ia64_copy_rbs to accept a byte count, this bug is fixed, ensuring correct unwinding behavior and preventing stack corruption.

For Context
IA64
Intel Itanium Architecture, a 64-bit VLIW (Very Long Instruction Word) processor architecture.
unwinder
A component of a runtime environment (like libgcc) that determines the call stack trace of a program, typically used for exception handling and debugging.
signal frame
A data structure on the stack that stores the state of a program when a signal is delivered, allowing the program to be resumed later.
alternate stack
A separate memory region designated for handling signals, often used to prevent stack overflow when the signal handler itself might consume significant stack space.
register backing store (RBS)
Memory used to save the state of registers when a function is called, especially in architectures with a large number of registers, to manage register pressure.
sc_loadrs
A register or memory location on IA64 systems that holds information related to the stack cache and load/store operations, potentially including register backing store size.
VLIW
Very Long Instruction Word. A type of processor architecture where instructions are grouped into long words, with each group containing multiple independent operations that can be executed in parallel by different functional units.
Filed Under: ia64unwindingbugfixsecurity