[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <03F0731F-3C87-47D9-A739-01289873572B@linux.dev>
Date: Thu, 17 Apr 2025 10:00:02 +0200
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: Oleg Nesterov <oleg@...hat.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: Remove unnecessary zero-length struct member
On 16. Apr 2025, at 04:33, Maciej W. Rozycki wrote:
> On Fri, 11 Apr 2025, Thorsten Blum wrote:
>
>> Remove the zero-length struct member '__last' and use sizeof() to
>> calculate the value for MAX_REG_OFFSET.
>>
>> No functional changes intended.
>
> Have you verified that there's no change except for timestamp data in
> (non-debug) `vmlinux' produced with and w/o the patch applied?
>
> Also this is broken anyway: if you use MAX_REG_OFFSET for `offset' passed
> to `regs_get_register', then data past the end of `regs' will be accessed.
Yes, true. It seems like
if (unlikely(offset >= MAX_REG_OFFSET))
return 0;
should do the trick.
The comment also says "If @offset is bigger than MAX_REG_OFFSET", rather
than "is bigger than or equal to".
Happy to add it to v2 or a separate patch, if this is actually correct?!
Thanks,
Thorsten
Powered by blists - more mailing lists