Merge "disp: msm: add check for buffer length before copy"

此提交包含在:
qctecmdr
2019-11-01 12:09:12 -07:00
提交者 Gerrit - the friendly Code Review server
當前提交 d34c5f2215
共有 3 個檔案被更改,包括 17 行新增3 行删除

查看文件

@@ -1809,7 +1809,10 @@ static ssize_t _sde_debugfs_conn_cmd_tx_sts_read(struct file *file,
return 0;
}
blen = min_t(size_t, MAX_CMD_PAYLOAD_SIZE, count);
if (blen > count)
blen = count;
blen = min_t(size_t, blen, MAX_CMD_PAYLOAD_SIZE);
if (copy_to_user(buf, buffer, blen)) {
SDE_ERROR("copy to user buffer failed\n");
return -EFAULT;