]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
IB extension: segfault in create collective group with non-vector type IA handle"
authorArlin Davis <arlin.r.davis@intel.com>
Tue, 24 Jun 2014 22:49:20 +0000 (15:49 -0700)
committerArlin Davis <arlin.r.davis@intel.com>
Tue, 24 Jun 2014 22:49:20 +0000 (15:49 -0700)
The dats_get_ia_handle call was change in 2.0.34 to convert IA handle from
both vector to handle and handle to vector to fix query calls that
incorrectly returned IA handles in non-vector form. If a caller uses a
non vector IA handle it will get converted incorrectly to a vector and cause
a segfault. Add additional check to verify a IA handle type before calling
get ia handle to avoid incorrect translation.

Signed-off-by: Arlin Davis <arlin.r.davis@intel.com>
dat/common/dat_api.c

index 50ffa2ca7879759ce1f18fb4f7120cd6d12ad027..7ca81a920bf7aab454bb0648ad38591fb3d8c63a 100755 (executable)
@@ -1078,7 +1078,7 @@ DAT_RETURN DAT_API dat_extension_op(IN DAT_HANDLE handle,
                                    IN DAT_EXTENDED_OP ext_op, IN ...)
 {
        DAT_RETURN status;
-       DAT_IA_HANDLE dapl_handle;
+       DAT_IA_HANDLE dapl_handle = handle;
        va_list args;
 
        if (handle == NULL) {
@@ -1086,10 +1086,12 @@ DAT_RETURN DAT_API dat_extension_op(IN DAT_HANDLE handle,
                                 DAT_INVALID_HANDLE1);
        }
 
-       /* If not IA handle then just passthrough */
-       if (dats_get_ia_handle(handle, &dapl_handle) != DAT_SUCCESS) {
-               dapl_handle = handle;
-       }
+       /* only convert if ia_handle vector */
+        if (dats_is_ia_handle(handle)) {
+                if (dats_get_ia_handle(handle, &dapl_handle))
+                        return DAT_ERROR(DAT_INVALID_HANDLE,
+                                         DAT_INVALID_HANDLE1);
+        }
 
        /* verify provider extension support */
        if (!g_dat_extensions) {