Re: [PATCH] reboot: keep parsed reboot CPU in range

From: Andrew Morton

Date: Wed Jun 24 2026 - 20:46:54 EST


On Mon, 22 Jun 2026 15:42:16 +0000 Bradley Morgan <include@xxxxxxxxx> wrote:

> reboot=s... parses the CPU number with simple_strtoul(), but stores
> it in an int before checking it against num_possible_cpus(). Very
> large values can wrap negative and bypass the range check, leaving
> reboot_cpu invalid for migrate_to_reboot_cpu().

Thanks. kstrtoXX() is the modern way.

> Keep the parsed value unsigned until after the range check.
>
> Fixes: f9a90501faac ("reboot: refactor and comment the cpu selection code")
> Cc: stable@xxxxxxxxxxxxxxx

I don't think this is serious enough to warrant backporting.