]> git.baikalelectronics.ru Git - kernel.git/commit
x86/kaslr: Drop test for command-line parameters before parsing
authorArvind Sankar <nivedita@alum.mit.edu>
Tue, 28 Jul 2020 22:57:14 +0000 (18:57 -0400)
committerIngo Molnar <mingo@kernel.org>
Fri, 31 Jul 2020 09:08:17 +0000 (11:08 +0200)
commit1b39f63467ef67c84572bd8e1b6f8216b4681dc7
tree6140d277cf8df222d2f45f41bceb957e0ac797e9
parentf69f967a925ca79236b233afae2c5a8e43b2e23a
x86/kaslr: Drop test for command-line parameters before parsing

This check doesn't save anything. In the case when none of the
parameters are present, each strstr will scan args twice (once to find
the length and then for searching), six scans in total. Just going ahead
and parsing the arguments only requires three scans: strlen, memcpy, and
parsing. This will be the first malloc, so free will actually free up
the memory, so the check doesn't save heap space either.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200728225722.67457-14-nivedita@alum.mit.edu
arch/x86/boot/compressed/kaslr.c