Whamcloud - gitweb
LU-9715 libcfs: crash in cpu_pattern parsing code 72/27872/3
authorAndreas Dilger <andreas.dilger@intel.com>
Wed, 28 Jun 2017 17:12:28 +0000 (11:12 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 8 Jul 2017 00:52:29 +0000 (00:52 +0000)
commit2165186b93838e62f04113a44f24e5cc20c7dbc1
treedb855e819ca7664b8d133490c2ad6b163738dd29
parent547e4021afb499f05cfbbf23e05b124587ca2ea8
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