Re: [PATCH v4] lib/bootconfig: guard xbc_node_compose_key_after() buffer size

From: Google

Date: Tue Mar 17 2026 - 23:07:33 EST


On Tue, 17 Mar 2026 20:43:27 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Wed, 18 Mar 2026 09:02:43 +0900
> Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:
>
> > Yes, that is checked in vsnprintf(), not its caller.
> > I think linux kernel should ensure the the return value is smaller
> > than INT_MAX, and return -EOVERFLOW if not.
>
> Well, there's very few places that could have a buffer size of > 2G.
>
> What's the max bootconfig limit? Could you create a bootconfig that is
> greater than 2G?

It's just 32KB. So we don't need it.
Anyway, I sent a patch about that.

https://lore.kernel.org/all/177379678638.535490.18200744206158553364.stgit@devnote2/

Thank you,

>
> If not, then yeah, we shouldn't really care about overflows (and that
> includes not worrying about typecasting the size variable to int).
>
> -- Steve
>


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