Re: [PATCH v2] MIPS: Fix MAX_REG_OFFSET and remove zero-length struct member

From: Thorsten Blum
Date: Fri Apr 18 2025 - 06:06:50 EST


On 18. Apr 2025, at 09:57, Thomas Bogendoerfer wrote:
> On Thu, Apr 17, 2025 at 07:47:13PM +0200, Thorsten Blum wrote:
>> Remove the unnecessary zero-length struct member '__last' and fix
>> MAX_REG_OFFSET to point to the last register in 'pt_regs'.
>>
>> Fixes: 40e084a506eba ("MIPS: Add uprobes support.")
>
> what does it fix ?

The value of MAX_REG_OFFSET and thus how regs_get_register() behaves.

From my understanding, MAX_REG_OFFSET points to the marker '__last[0]'
instead of the actual last register in 'pt_regs', which could allow
regs_get_register() to return an invalid offset.

Let me know if I'm missing anything.

Thanks,
Thorsten