]> git.baikalelectronics.ru Git - kernel.git/commit
[S390] Check for NULL termination in command line setup
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Tue, 27 Dec 2011 10:25:46 +0000 (11:25 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 27 Dec 2011 10:25:48 +0000 (11:25 +0100)
commit1e66e2e8fb6ff47279d4022cd1b74f61952af2d4
tree64916e26ab8b5773cc76d05260560a36bcf7a6a4
parentdf611f05db245218bfd4509c737bdf203b545d54
[S390] Check for NULL termination in command line setup

The current code in setup_boot_command_line() uses a heuristic to
detect an EBCDIC command line. It checks if any of the bytes in
the command line has bit one (0x80) set. In that case it is assumed
that we have an EBCDIC string and the complete command line is
converted.

On s390 there are cases where the boot loader provides a kernel
command line that is NULL terminated, but has random data after
the NULL termination. In that case, setup_boot_command_line()
might misinterpret an ASCII string for an EBCDIC string. A
subsequent string conversion can then damage the ASCII string.

This patch solves the problem by checking for NULL termination.
If no EBCDIC character has been found until the the NULL
termination has been found, we now assume that we have an ASCII
string.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/early.c