This adds to check the size of copy_from_user().
Change-Id: Icb869f2906881889305beea6b4fb3bbd9ef14f08
Signed-off-by: Sunyoung Kang <sy0816.kang@samsung.com>
memcpy(&enc->roi_info[index],
enc->sh_handle_roi.vaddr,
sizeof(struct mfc_enc_roi_info));
+ if (enc->roi_info[index].size > enc->roi_buf[index].size) {
+ mfc_err_ctx("[MEMINFO][ROI] roi info size %d is over\n",
+ enc->roi_info[index].size);
+ return -EINVAL;
+ }
if (copy_from_user(enc->roi_buf[index].vaddr,
enc->roi_info[index].addr,
enc->roi_info[index].size))