Re: [PATCH] lib/vsprintf: Require exact hash_pointers mode matches
From: Petr Mladek
Date: Tue May 26 2026 - 05:20:19 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>
JFYI, the patch has been committed into printk/linux.git,
branch for-7.2.
Best Regards,
Petr