Re: [PATCH] lib/vsprintf: Require exact hash_pointers mode matches

From: Petr Mladek

Date: Thu May 21 2026 - 07:57:07 EST


On Tue 2026-05-19 21:01:17, Kaitao Cheng wrote:
> From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
>
> hash_pointers= accepts a small set of mode strings, but the parser uses
> strncmp() with the length of each valid mode. That accepts values with
> trailing garbage, such as hash_pointers=autobots or
> hash_pointers=nevermind, as valid aliases for auto and never.
>
> Use strcmp() so that only the documented mode strings are accepted.
> Invalid values will continue to fall back to auto through the existing
> unknown-mode path.
>
> Signed-off-by: Kaitao Cheng <chengkaitao@xxxxxxxxxx>

LGTM:

Reviewed-by: Petr Mladek <pmladek@xxxxxxxx>

I am going to queue this patch via the printk tree early next
week unless anyone complains in the meantime.

Best Regards,
Petr