From 9bb5212cfeca4a62288467fceac6b0611a11ffe4 Mon Sep 17 00:00:00 2001 From: Arlin Davis Date: Tue, 24 Jun 2014 15:49:20 -0700 Subject: [PATCH] IB extension: segfault in create collective group with non-vector type IA handle" 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 --- dat/common/dat_api.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dat/common/dat_api.c b/dat/common/dat_api.c index 50ffa2c..7ca81a9 100755 --- a/dat/common/dat_api.c +++ b/dat/common/dat_api.c @@ -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) { -- 2.46.0