diff --git a/.gitupstream b/.gitupstream
new file mode 100644
index 0000000..dde8122
--- /dev/null
+++ b/.gitupstream
@@ -0,0 +1 @@
+https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/display-commonsys
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..ad6d5eb
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,5 @@
+soong_namespace {
+    imports: [
+        "vendor/qcom/opensource/commonsys-intf/display"
+    ],
+}
diff --git a/services/config/src/device_impl.cpp b/services/config/src/device_impl.cpp
index 4541368..5d1fcdd 100644
--- a/services/config/src/device_impl.cpp
+++ b/services/config/src/device_impl.cpp
@@ -30,7 +30,7 @@
 /*
  * Changes from Qualcomm Innovation Center are provided under the following license:
  *
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted (subject to the limitations in the
@@ -82,13 +82,13 @@
       return -1;
     }
 
+    device_obj_->intf_ = intf;
     android::status_t status = device_obj_->IDisplayConfig::registerAsService();
     // Unable to start Display Config 2.0 service. Fail Init.
     if (status != android::OK) {
       device_obj_ = nullptr;
       return -1;
     }
-    device_obj_->intf_ = intf;
   }
 
   return 0;
@@ -146,6 +146,7 @@
 
 void DeviceImpl::serviceDied(uint64_t client_handle,
                              const android::wp<::android::hidl::base::V1_0::IBase>& callback) {
+  std::lock_guard<std::shared_mutex> exclusive_lock(shared_mutex_);
   std::lock_guard<std::recursive_mutex> lock(death_service_mutex_);
   auto itr = display_config_map_.find(client_handle);
   std::shared_ptr<DeviceClientContext> client = itr->second;
@@ -232,6 +233,10 @@
   bool connected = false;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(DisplayType)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   dpy = reinterpret_cast<const DisplayType*>(data);
   int32_t error = intf_->IsDisplayConnected(*dpy, &connected);
@@ -245,6 +250,11 @@
                                                             perform_cb _hidl_cb) {
   const struct StatusParams *display_status;
   const uint8_t *data = input_params.data();
+
+  if (input_params.size() != sizeof(StatusParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   display_status = reinterpret_cast<const StatusParams*>(data);
   int32_t error = intf_->SetDisplayStatus(display_status->dpy,
                                           display_status->status);
@@ -255,6 +265,11 @@
                                                                    perform_cb _hidl_cb) {
   const struct DynRefreshRateParams *dyn_refresh_data;
   const uint8_t *data = input_params.data();
+
+  if (input_params.size() != sizeof(DynRefreshRateParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   dyn_refresh_data = reinterpret_cast<const DynRefreshRateParams*>(data);
   int32_t error = intf_->ConfigureDynRefreshRate(dyn_refresh_data->op,
                                                  dyn_refresh_data->refresh_rate);
@@ -272,6 +287,10 @@
     return;
   }
 
+  if (input_params.size() != sizeof(DisplayType)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   dpy = reinterpret_cast<const DisplayType*>(data);
   int32_t error = intf_->GetConfigCount(*dpy, &count);
@@ -286,6 +305,10 @@
   uint32_t config = 0;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(DisplayType)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   dpy = reinterpret_cast<const DisplayType*>(data);
   int32_t error = intf_->GetActiveConfig(*dpy, &config);
@@ -298,6 +321,10 @@
                                                            perform_cb _hidl_cb) {
   const struct ConfigParams *set_active_cfg_data;
 
+  if (input_params.size() != sizeof(ConfigParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   set_active_cfg_data = reinterpret_cast<const ConfigParams*>(data);
   int32_t error = intf_->SetActiveConfig(set_active_cfg_data->dpy,
@@ -312,6 +339,10 @@
   ByteStream output_params;
   int32_t error = -EINVAL;
 
+  if (input_params.size() != sizeof(AttributesParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   get_disp_attr_data = reinterpret_cast<const AttributesParams*>(data);
   error = intf_->GetDisplayAttributes(get_disp_attr_data->config_index, get_disp_attr_data->dpy,
@@ -326,6 +357,10 @@
   const uint32_t *level;
   int32_t error = 0;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   level = reinterpret_cast<const uint32_t*>(data);
   error = intf_->SetPanelBrightness(*level);
@@ -351,6 +386,10 @@
   const struct MinHdcpEncLevelChangedParams *min_hdcp_enc_level_data;
   int32_t error = 0;
 
+  if (input_params.size() != sizeof(MinHdcpEncLevelChangedParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   min_hdcp_enc_level_data = reinterpret_cast<const MinHdcpEncLevelChangedParams*>(data);
   error = intf_->MinHdcpEncryptionLevelChanged(min_hdcp_enc_level_data->dpy,
@@ -369,6 +408,10 @@
   const struct PartialUpdateParams *partial_update_data;
   int32_t error = 0;
 
+  if (input_params.size() != sizeof(PartialUpdateParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   partial_update_data = reinterpret_cast<const PartialUpdateParams*>(data);
   error = intf_->ControlPartialUpdate(partial_update_data->dpy, partial_update_data->enable);
@@ -381,6 +424,10 @@
   const bool *on;
   int32_t error = 0;
 
+  if (input_params.size() != sizeof(bool)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   on = reinterpret_cast<const bool*>(data);
   error = intf_->ToggleScreenUpdate(on);
@@ -392,6 +439,10 @@
                                                           perform_cb _hidl_cb) {
   const uint32_t *timeout_value;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   timeout_value = reinterpret_cast<const uint32_t*>(data);
   int32_t error = intf_->SetIdleTimeout(*timeout_value);
@@ -407,6 +458,10 @@
   int32_t *data_output;
   int32_t error = -EINVAL;
 
+  if (input_params.size() != sizeof(DisplayType)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   dpy = reinterpret_cast<const DisplayType*>(data);
   error = intf_->GetHDRCapabilities(*dpy, &hdr_caps);
@@ -436,6 +491,10 @@
                                                                  perform_cb _hidl_cb) {
   const uint32_t *launch_status_data;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   launch_status_data = reinterpret_cast<const uint32_t*>(data);
 
@@ -448,6 +507,10 @@
                                                            perform_cb _hidl_cb) {
   const CameraSmoothInfo *camera_info;
 
+  if (input_params.size() != sizeof(CameraSmoothInfo)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   camera_info = reinterpret_cast<const CameraSmoothInfo*>(data);
   int32_t error = intf_->SetCameraSmoothInfo(camera_info->op, camera_info->fps);
@@ -458,6 +521,10 @@
                                                                 perform_cb _hidl_cb) {
   const bool *enable;
 
+  if (input_params.size() != sizeof(bool)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   enable = reinterpret_cast<const bool*>(data);
 
@@ -481,6 +548,10 @@
                                                                perform_cb _hidl_cb) {
   const struct AnimationParams *display_animating_data;
 
+  if (input_params.size() != sizeof(AnimationParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   display_animating_data = reinterpret_cast<const AnimationParams*>(data);
   int32_t error = intf_->SetDisplayAnimating(display_animating_data->display_id,
@@ -493,6 +564,10 @@
                                                                     perform_cb _hidl_cb) {
   const struct IdlePcParams *idle_pc_data;
 
+  if (input_params.size() != sizeof(IdlePcParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   idle_pc_data = reinterpret_cast<const IdlePcParams*>(data);
   int32_t error = intf_->ControlIdlePowerCollapse(idle_pc_data->enable, idle_pc_data->synchronous);
@@ -514,6 +589,10 @@
                                                                perform_cb _hidl_cb) {
   const struct DppsAdRoiParams *ad_roi_data;
 
+  if (input_params.size() != sizeof(DppsAdRoiParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   ad_roi_data = reinterpret_cast<const DppsAdRoiParams*>(data);
 
@@ -539,6 +618,10 @@
                                                         perform_cb _hidl_cb) {
   const struct PowerModeParams *set_power_mode_data;
 
+  if (input_params.size() != sizeof(PowerModeParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   set_power_mode_data = reinterpret_cast<const PowerModeParams*>(data);
   int32_t error = intf_->SetPowerMode(set_power_mode_data->disp_id,
@@ -549,6 +632,10 @@
 void DeviceImpl::DeviceClientContext::ParseIsPowerModeOverrideSupported(
                                       const ByteStream &input_params,
                                       perform_cb _hidl_cb) {
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
   bool supported = false;
@@ -562,6 +649,10 @@
 
 void DeviceImpl::DeviceClientContext::ParseIsHdrSupported(const ByteStream &input_params,
                                                           perform_cb _hidl_cb) {
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
   bool supported = false;
@@ -575,6 +666,10 @@
 
 void DeviceImpl::DeviceClientContext::ParseIsWcgSupported(const ByteStream &input_params,
                                                           perform_cb _hidl_cb) {
+  if (input_params.size() != sizeof(int32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const int32_t *disp_id = reinterpret_cast<const int32_t*>(data);
   bool supported = false;
@@ -590,6 +685,10 @@
                                                           perform_cb _hidl_cb) {
   const struct LayerMaskParams *layer_mask_data;
 
+  if (input_params.size() != sizeof(LayerMaskParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   layer_mask_data = reinterpret_cast<const LayerMaskParams*>(data);
   int32_t error = intf_->SetLayerAsMask(layer_mask_data->disp_id, layer_mask_data->layer_id);
@@ -602,6 +701,10 @@
   std::string value;
   ByteStream output_params;
 
+  if (input_params.size() == 0) {
+    _hidl_cb(-ENODATA, {}, {});
+     return;
+  }
   const uint8_t *data = input_params.data();
   const char *name = reinterpret_cast<const char *>(data);
   std::string prop_name(name);
@@ -629,6 +732,10 @@
                                       perform_cb _hidl_cb) {
   const struct PanelLumAttrParams *panel_lum_attr_data;
 
+  if (input_params.size() != sizeof(PanelLumAttrParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   panel_lum_attr_data = reinterpret_cast<const PanelLumAttrParams*>(data);
   int32_t error = intf_->SetPanelLuminanceAttributes(panel_lum_attr_data->disp_id,
@@ -644,6 +751,10 @@
   bool is_builtin = false;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   disp_id = reinterpret_cast<const uint32_t*>(data);
   int32_t error = intf_->IsBuiltInDisplay(*disp_id, &is_builtin);
@@ -659,6 +770,10 @@
                                                               perform_cb _hidl_cb) {
   const struct CwbBufferParams *cwb_buffer_data;
 
+  if (input_params.size() != sizeof(CwbBufferParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   cwb_buffer_data = reinterpret_cast<const CwbBufferParams*>(data);
   hidl_handle buffer = input_handles[0];
@@ -681,6 +796,10 @@
   std::vector<uint64_t> bit_clks;
   uint64_t *bit_clks_data;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   disp_id = reinterpret_cast<const uint32_t*>(data);
   int32_t error = intf_->GetSupportedDSIBitClks(*disp_id, &bit_clks);
@@ -704,6 +823,10 @@
   uint64_t bit_clk = 0;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   disp_id = reinterpret_cast<const uint32_t*>(data);
   int32_t error = intf_->GetDSIClk(*disp_id, &bit_clk);
@@ -717,6 +840,10 @@
                                                      perform_cb _hidl_cb) {
   const struct DsiClkParams *set_dsi_clk_data;
 
+  if (input_params.size() != sizeof(DsiClkParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   set_dsi_clk_data = reinterpret_cast<const DsiClkParams*>(data);
   int32_t error = intf_->SetDSIClk(set_dsi_clk_data->disp_id, set_dsi_clk_data->bit_clk);
@@ -727,6 +854,10 @@
                                                         perform_cb _hidl_cb) {
   const struct QsyncModeParams *set_qsync_mode_data;
 
+  if (input_params.size() != sizeof(QsyncModeParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   set_qsync_mode_data = reinterpret_cast<const QsyncModeParams*>(data);
   int32_t error = intf_->SetQsyncMode(set_qsync_mode_data->disp_id, set_qsync_mode_data->mode);
@@ -739,6 +870,10 @@
   bool is_smart = false;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(SmartPanelCfgParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   smart_panel_cfg_data = reinterpret_cast<const SmartPanelCfgParams*>(data);
   int32_t error = intf_->IsSmartPanelConfig(smart_panel_cfg_data->disp_id,
@@ -763,6 +898,10 @@
                                                                 perform_cb _hidl_cb) {
   const struct VdsParams *vds_input_data;
 
+  if (input_params.size() != sizeof(VdsParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   vds_input_data = reinterpret_cast<const VdsParams*>(data);
 
@@ -778,6 +917,10 @@
   bool supported = false;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(RotatorFormatParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   input_data = reinterpret_cast<const RotatorFormatParams*>(data);
   int32_t error = intf_->IsRotatorSupportedFormat(input_data->hal_format, input_data->ubwc,
@@ -793,6 +936,10 @@
                                                                 perform_cb _hidl_cb) {
   const bool *enable;
 
+  if (input_params.size() != sizeof(bool)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   enable = reinterpret_cast<const bool*>(data);
 
@@ -806,6 +953,10 @@
                                                                      perform_cb _hidl_cb) {
   const bool *enable;
 
+  if (input_params.size() != sizeof(bool)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   enable = reinterpret_cast<const bool*>(data);
 
@@ -819,6 +970,10 @@
   const struct TUIEventParams *input_data =
                reinterpret_cast<const TUIEventParams*>(input_params.data());
 
+  if (input_params.size() != sizeof(TUIEventParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   int32_t error = intf_->SendTUIEvent(input_data->dpy, input_data->tui_event_type);
 
   _hidl_cb(error, {}, {});
@@ -850,6 +1005,10 @@
   uint32_t disp_hw_id = 0;
   ByteStream output_params;
 
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
   int32_t error = intf_->GetDisplayHwId(*disp_id, &disp_hw_id);
@@ -863,6 +1022,10 @@
   ByteStream output_params;
   std::vector<uint32_t> refresh_rates;
 
+  if (input_params.size() != sizeof(DisplayType)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const DisplayType *dpy = reinterpret_cast<const DisplayType *>(data);
   int32_t error = intf_->GetSupportedDisplayRefreshRates(*dpy, &refresh_rates);
@@ -884,6 +1047,11 @@
 void DeviceImpl::DeviceClientContext::ParseIsRCSupported(const ByteStream &input_params,
                                                          perform_cb _hidl_cb) {
   const uint8_t *data = input_params.data();
+
+  if (input_params.size() != sizeof(uint32_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint32_t *disp_id = reinterpret_cast<const uint32_t*>(data);
   bool supported = false;
   int32_t error = intf_->IsRCSupported(*disp_id, &supported);
@@ -901,6 +1069,11 @@
   }
 
   const struct SupportedModesParams *supported_modes_data;
+
+  if (input_params.size() != sizeof(SupportedModesParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   bool supported = false;
   ByteStream output_params;
@@ -914,6 +1087,10 @@
 
 void DeviceImpl::DeviceClientContext::ParseGetDisplayType(const ByteStream &input_params,
                                                           perform_cb _hidl_cb) {
+  if (input_params.size() != sizeof(uint64_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   const uint64_t *physical_disp_id = reinterpret_cast<const uint64_t*>(data);
   DisplayType disp_type = DisplayConfig::DisplayType::kInvalid;
@@ -931,6 +1108,10 @@
 
 void DeviceImpl::DeviceClientContext::ParseGetDisplayTileCount(const ByteStream &input_params,
                                                                perform_cb _hidl_cb) {
+  if (input_params.size() != sizeof(uint64_t)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint64_t *data = reinterpret_cast<const uint64_t*>(input_params.data());
   uint64_t physical_disp_id = data ? *data : 0;
   uint32_t num_tiles[2] = {0, 0};
@@ -947,6 +1128,10 @@
                                                              perform_cb _hidl_cb) {
   struct PowerModeTiledParams set_power_mode_tiled_data = {};
 
+  if (input_params.size() != sizeof(PowerModeTiledParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   if (data) {
     set_power_mode_tiled_data = *reinterpret_cast<const PowerModeTiledParams*>(data);
@@ -962,6 +1147,10 @@
                                                                    perform_cb _hidl_cb) {
   struct PanelBrightnessTiledParams set_panel_brightness_tiled_data = {};
 
+  if (input_params.size() != sizeof(PanelBrightnessTiledParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   if (data) {
     set_panel_brightness_tiled_data = *reinterpret_cast<const PanelBrightnessTiledParams*>(data);
@@ -977,6 +1166,10 @@
                                                                   perform_cb _hidl_cb) {
   struct WiderModePrefParams set_wider_mode_pref_data = {};
 
+  if (input_params.size() != sizeof(WiderModePrefParams)) {
+    _hidl_cb(-ENODATA, {}, {});
+    return;
+  }
   const uint8_t *data = input_params.data();
   if (data) {
     set_wider_mode_pref_data = *reinterpret_cast<const WiderModePrefParams*>(data);
@@ -989,16 +1182,21 @@
 Return<void> DeviceImpl::perform(uint64_t client_handle, uint32_t op_code,
                                  const ByteStream &input_params, const HandleStream &input_handles,
                                  perform_cb _hidl_cb) {
+  std::shared_lock<std::shared_mutex> shared_lock(shared_mutex_);
   int32_t error = 0;
-  std::lock_guard<std::recursive_mutex> lock(death_service_mutex_);
-  auto itr = display_config_map_.find(client_handle);
-  if (itr == display_config_map_.end()) {
-    error = -EINVAL;
-    _hidl_cb(error, {}, {});
-    return Void();
+  std::shared_ptr<DeviceClientContext> client = nullptr;
+
+  {
+    std::lock_guard<std::recursive_mutex> lock(death_service_mutex_);
+    auto itr = display_config_map_.find(client_handle);
+    if (itr == display_config_map_.end()) {
+      error = -EINVAL;
+      _hidl_cb(error, {}, {});
+      return Void();
+    }
+    client = itr->second;
   }
 
-  std::shared_ptr<DeviceClientContext> client = itr->second;
   if (!client) {
     error = -EINVAL;
     _hidl_cb(error, {}, {});
diff --git a/services/config/src/device_impl.h b/services/config/src/device_impl.h
index cf60366..3433d05 100644
--- a/services/config/src/device_impl.h
+++ b/services/config/src/device_impl.h
@@ -74,6 +74,7 @@
 #include <utility>
 #include <string>
 #include <vector>
+#include <shared_mutex>
 
 #include "opcode_types.h"
 
@@ -187,6 +188,7 @@
   std::map<uint64_t, std::shared_ptr<DeviceClientContext>> display_config_map_;
   uint64_t client_id_ = 0;
   std::recursive_mutex death_service_mutex_;
+  std::shared_mutex shared_mutex_;
   static DeviceImpl *device_obj_;
   static std::mutex device_lock_;
 };
