]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries: Correct possible read beyond dlpar sysfs buffer
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Thu, 17 Nov 2016 16:38:10 +0000 (11:38 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Nov 2016 11:40:38 +0000 (22:40 +1100)
commit66ae46ab1dfb6a972e78d61662fb103e8cd66ae3
treefa6025f02aff8a40f412c76c7e607f38e8b51135
parenta2431595dce7b922e185c4d7ee9df23889e4da08
powerpc/pseries: Correct possible read beyond dlpar sysfs buffer

The pasrsing of data written to the dlpar file in sysfs does not correctly
account for the possibility of reading past the end of the buffer. The code
assumes that all pieces of the command witten to the sysfs file are present
in the form "<resource> <action> <id_type> <id>".

Correct this by updating the buffer parsing code to make a local copy and
use the strsep() and sysfs_streq() routines to parse the buffer. This patch
also separates the parsing code into subroutines for each piece of the
command.

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/dlpar.c