[PATCH v1 6/7] aarch64: fix buffer overflow in aarch64-gen

Matthieu Longo matthieu.longo@arm.com
Thu Feb 5 14:24:16 GMT 2026


On 03/02/2026 14:17, Alice Carlotti wrote:
> On Tue, Feb 03, 2026 at 10:00:47AM +0000, Matthieu Longo wrote:
>> A refactoring in [1] introduced a buffer overflow. A new enum value,
>> last_iclass, was added at the end of 'enum aarch64_insn_class' to
>> refer to the last instruction class. This value is then used to size
>> the array iclass_has_subclasses_p, which is intended to have one
>> element per enum value.
>>
>> However, because the enum values start at index 0, last_iclass is
>> off by one when used as the array length. As a result, the array is
>> allocated with element too few, leading to a buffer overflow when
>> accessing the 'lut' class.
>>
>> The fix adds +1 to last_iclass when defining the array size.
> 
> OK, thanks
>

Merged.


More information about the Binutils mailing list