linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] fix parsing of reboot= cmdline
@ 2020-10-27 13:35 Matteo Croce
  2020-10-27 13:35 ` [PATCH v2 1/2] reboot: fix overflow parsing reboot cpu number Matteo Croce
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Matteo Croce @ 2020-10-27 13:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Guenter Roeck, Petr Mladek, Arnd Bergmann, Mike Rapoport,
	Kees Cook, Pavel Tatashin, Robin Holt, Fabian Frederick, stable

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.

v1->v2:
As Petr suggested, don't force base 10 in simple_strtoul(),
so hex values are accepted as well.

Matteo Croce (2):
  reboot: fix overflow parsing reboot cpu number
  reboot: fix parsing of reboot cpu number

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

-- 
2.28.0


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

end of thread, other threads:[~2020-11-03 16:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 13:35 [PATCH v2 0/2] fix parsing of reboot= cmdline Matteo Croce
2020-10-27 13:35 ` [PATCH v2 1/2] reboot: fix overflow parsing reboot cpu number Matteo Croce
2020-10-27 13:42   ` Greg KH
2020-10-30 14:13     ` Petr Mladek
2020-10-30 14:18       ` Matteo Croce
2020-10-27 13:35 ` [PATCH v2 2/2] reboot: fix parsing of " Matteo Croce
2020-10-27 13:42   ` Greg KH
2020-10-30 14:30   ` Petr Mladek
2020-11-01  1:57     ` Matteo Croce
2020-11-02 11:01       ` Petr Mladek
2020-11-03 11:43         ` Matteo Croce
2020-11-03 14:25           ` Petr Mladek
2020-11-03 15:43             ` Matteo Croce
2020-11-03 16:22               ` Petr Mladek
2020-10-27 13:42 ` [PATCH v2 0/2] fix parsing of reboot= cmdline Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).