Whamcloud - gitweb
LU-3233 mdt: validate open handle cookies 38/6938/3
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 10 Jul 2013 20:45:18 +0000 (15:45 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 19 Jul 2013 04:35:26 +0000 (04:35 +0000)
commit419e094e39885195caa7d652cc4dd800402b3079
tree8b5a756972c20e133c1f8f1a86b8c43309796522
parente04275c86d39e47d1d68137dd86a76f1e60a6a55
LU-3233 mdt: validate open handle cookies

Add a const void *h_owner member to struct portals_handle. Add a const
void *owner parameter to class_handle2object() which must be matched
by the h_owner member of the handle in addition to the cookie.  Adjust
the callers of class_handle2object() accordingly, using NULL as the
argument to the owner parameter, except in the case of
mdt_handle2mfd() where we add an explicit mdt_export_data parameter
which we use as the owner when searching for a MFD. When allocating a
new MFD, pass a pointer to the mdt_export_data into mdt_mfd_new() and
store it in h_owner. This allows the MDT to validate that the client
has not sent the wrong open handle cookie, or sent the right cookie to
the wrong MDT.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I4c26504d808db0c27cfc2f8ebcf7e1fa19719170
Reviewed-on: http://review.whamcloud.com/6938
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
lustre/include/lustre_handles.h
lustre/ldlm/ldlm_lock.c
lustre/lov/lov_internal.h
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/obdclass/genops.c
lustre/obdclass/lustre_handles.c