Re: [PATCH v2 2/3] lib/bootconfig: check bounds before writing in __xbc_open_brace()

From: Josh Law

Date: Thu Mar 12 2026 - 17:30:17 EST


12 Mar 2026 21:28:11 Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>:

> On Thu, 12 Mar 2026 21:09:52 +0000 Josh Law <hlcj1234567@xxxxxxxxx> wrote:
>
>>> That's a fair point, Steve. Given that brace_index isn't touched elsewhere and the current check effectively prevents the overflow, I agree this isn't strictly necessary. I'll drop this patch and stick with the fix for the off-by-one reporting error instead. Thanks for the feedback!
>>
>> Wait Steve,
>> Thanks for the look. I see your point that it's currently redundant given the call patterns. It looks like Andrew has already merged this into the -mm tree, likely as a 'belt-and-suspenders' safety measure. I'll keep your feedback in mind for future cleanup, but I'm glad we got the other off-by-one fix in as well!
>
> Please wordwrap the emails.
>
>> And in my opinion, merging it is a decent idea.
>
> You've changed your position without explaining why?

Sorry, I think it should be merged because it's better to be safe than sorry, I know there is different methods of implementation, but this one still works... I know it's churn (and I'm sorry)