فهرست منبع

msm: ipa: Fix use-after-free in ipa3_alloc_counter_id

Make changes to memcopy before preload end.

Change-Id: 	Icc056a3bcd5b739b8165813202c87dd84e72c78a
Signed-off-by: Michael Adisumarta <[email protected]>
Michael Adisumarta 3 سال پیش
والد
کامیت
669d4f210f
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/platform/msm/ipa/ipa_v3/ipa_utils.c

+ 1 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_utils.c

@@ -9395,9 +9395,9 @@ mark_sw_cnt:
 done:
 	/* get a handle from idr for dealloc */
 	counter->hdl = __ipa3_alloc_counter_hdl(counter);
+	memcpy(header, counter, sizeof(struct ipa_ioc_flt_rt_counter_alloc));
 	spin_unlock(&ipa3_ctx->flt_rt_counters.hdl_lock);
 	idr_preload_end();
-	memcpy(header, counter, sizeof(struct ipa_ioc_flt_rt_counter_alloc));
 	return 0;
 
 err: