Re: [PATCH v4 0/2] lib/vsprintf: Fixes size check

From: Andrew Morton

Date: Wed Mar 25 2026 - 01:05:03 EST


On Wed, 25 Mar 2026 11:25:06 +0900 "Masami Hiramatsu (Google)" <mhiramat@xxxxxxxxxx> wrote:

> Here is the 4th version of patches to fix vsnprintf().
>
> - Fix to limit the size of width and precision.
> - Warn if the return size is over INT_MAX.
>
> Previous version is here;
>
> https://lore.kernel.org/all/177410406326.38798.16853803119128725972.stgit@devnote2/
>
> In this version, do clamp() the width and precision before checking it and
> accept negative precision[1/3] and add Petr's Reviewed-by[2/2].

AI review has flagged a couple of possible issues:
https://sashiko.dev/#/patchset/177440550682.147866.1854734911195480940.stgit@devnote2