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

From: Google

Date: Fri Mar 13 2026 - 00:18:26 EST


On Thu, 12 Mar 2026 21:30:10 +0000
Josh Law <hlcj1234567@xxxxxxxxx> wrote:

> 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)

I would like to keep this original >= because it is safer.
Andrew, I will pick these patches with my test patch.

Thank you,


--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>