Whamcloud - gitweb
LU-9715 libcfs: crash in cpu_pattern parsing code
authorAndreas Dilger <andreas.dilger@intel.com>
Wed, 28 Jun 2017 17:12:28 +0000 (11:12 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 10 Jul 2017 21:14:01 +0000 (17:14 -0400)
commit9b456bacb7a3c55f6baaf78607f8c1c0567f0997
treebd29103fcd4908c49cec61071693fd0b2c07e49f
parenta9d45ef39a471595709a31b3d60b0c67b7af0c91
LU-9715 libcfs: crash in cpu_pattern parsing code

The for loop in cfs_cpt_table_create_pattern() that scans
for brackets to count the number of cpts is broken. It will
increment bracket beyond NULL and it will increment ncpt
beyond the number of available cpts. This has been fixed.

Test-Parameters: trivial
Signed-off-by: Amir Shehata <amir.shehata@intel.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I87bc9de4c531c42c421e8e62edd881417dbcab07
Reviewed-on: https://review.whamcloud.com/27872
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Olaf Weber <olaf.weber@hpe.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
libcfs/libcfs/linux/linux-cpu.c