mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] fix parsing of reboot= cmdline
@ 2020-11-03 21:40 Matteo Croce
  2020-11-03 21:40 ` [PATCH v3 1/3] Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint" Matteo Croce
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matteo Croce @ 2020-11-03 21:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: Guenter Roeck, Petr Mladek, Arnd Bergmann, Mike Rapoport,
	Kees Cook, Pavel Tatashin, Robin Holt, Fabian Frederick,
	Andrew Morton, Greg Kroah-Hartman

From: Matteo Croce <mcroce@microsoft.com>

The parsing of the reboot= cmdline has two major errors:
- a missing bound check can crash the system on reboot
- parsing of the cpu number only works if specified last

Fix both, along with a small code refactor.

v2->v3:
Revert the offending commit first, then fix the other bug.
CC stable
v1->v2:
As Petr suggested, don't force base 10 in simple_strtoul(),
so hex values are accepted as well.

Matteo Croce (3):
  Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint"
  reboot: fix overflow parsing reboot cpu number
  reboot: refactor and comment the cpu selection code

 kernel/reboot.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

-- 
2.28.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-06 10:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 21:40 [PATCH v3 0/3] fix parsing of reboot= cmdline Matteo Croce
2020-11-03 21:40 ` [PATCH v3 1/3] Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint" Matteo Croce
2020-11-05 18:02   ` Petr Mladek
2020-11-03 21:40 ` [PATCH v3 2/3] reboot: fix overflow parsing reboot cpu number Matteo Croce
2020-11-05 18:09   ` Petr Mladek
2020-11-05 18:14     ` Matteo Croce
2020-11-06 10:18       ` Petr Mladek
2020-11-03 21:40 ` [PATCH v3 3/3] reboot: refactor and comment the cpu selection code Matteo Croce
2020-11-05 18:09   ` Petr Mladek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome