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)
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>

No differences found