Whamcloud - gitweb
LU-10264 mdc: fix possible NULL pointer dereference 21/31621/3
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 9 Mar 2018 23:18:53 +0000 (16:18 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:45:47 +0000 (19:45 +0000)
commitb8920647617433ff85a9ad1b603fa25d40782d9b
tree4e10514a3c119e8198e11493836b47050e684ed5
parent7ec8e4751fdf22894eef67972b094cd9f28ec3a0
LU-10264 mdc: fix possible NULL pointer dereference

Fix two static analysis errors.

lustre/mdc/mdc_dev.c: in mdc_enqueue_send(), pointer 'matched' return
    from call to function 'ldlm_handle2lock' at line 704 may be NULL
    and will be dereferenced at line 705.
If client is evicted between ldlm_lock_match() and ldlm_handle2lock()
the lock pointer could be NULL.

lustre/lov/lov_dev.c:488 in lov_process_config, sscanf format
    specification '%d' expects type 'int' for 'd', but parameter 3
    has a different type '__u32'.
Converting to kstrtou32() requires changing the "index" variable type
from __u32 to u32, which is fine since it is only used internally,
fix up the few functions that are also passing "__u32 index" and the
resulting checkpatch.pl warnings.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I3cc80d66bbb537161a561f4f2ba7830ddebcab07
Reviewed-on: https://review.whamcloud.com/31621
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lov/lov_dev.c
lustre/lov/lov_internal.h
lustre/lov/lov_obd.c
lustre/mdc/mdc_dev.c