Whamcloud - gitweb
LU-3233 mdt: validate open handle cookies
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 10 Jul 2013 20:45:18 +0000 (15:45 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 8 Aug 2013 05:49:46 +0000 (01:49 -0400)
commitdf01bb37a5e8992ade0ab74386bc76a6d42e0235
tree1ff97cc13bba0209aa643b41dd94867aea3ee690
parent5e9646ded8a35f1f0b7f3f1eadbd8ab4d927c4a5
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