mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
mm-camera: Changes to remove unused code for security issue reported
Changes to remove MSM_CAM_IOCTL_SET_MEM_MAP_INFO Ioctl support. This will avoid physical memory mapping to userspace. Change-Id: If014e6d152786b508c8e7ee6c53631913cd4cfcf Signed-off-by: Guruprasad Gaonkar <ggaonk@codeaurora.org> Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
This commit is contained in:
parent
4feaaa3c74
commit
449d60889d
1 changed files with 0 additions and 41 deletions
|
@ -2623,40 +2623,6 @@ static unsigned int msm_poll_config(struct file *fp,
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int msm_mmap_config(struct file *fp, struct vm_area_struct *vma)
|
||||
{
|
||||
struct msm_cam_config_dev *config_cam = fp->private_data;
|
||||
int rc = 0;
|
||||
int phyaddr;
|
||||
int retval;
|
||||
unsigned long size;
|
||||
|
||||
D("%s: phy_addr=0x%x", __func__, config_cam->mem_map.cookie);
|
||||
phyaddr = (int)config_cam->mem_map.cookie;
|
||||
if (!phyaddr) {
|
||||
pr_err("%s: no physical memory to map", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
memset(&config_cam->mem_map, 0,
|
||||
sizeof(struct msm_mem_map_info));
|
||||
size = vma->vm_end - vma->vm_start;
|
||||
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
|
||||
retval = remap_pfn_range(vma, vma->vm_start,
|
||||
phyaddr >> PAGE_SHIFT,
|
||||
size, vma->vm_page_prot);
|
||||
if (retval) {
|
||||
pr_err("%s: remap failed, rc = %d",
|
||||
__func__, retval);
|
||||
rc = -ENOMEM;
|
||||
goto end;
|
||||
}
|
||||
D("%s: phy_addr=0x%x: %08lx-%08lx, pgoff %08lx\n",
|
||||
__func__, (uint32_t)phyaddr,
|
||||
vma->vm_start, vma->vm_end, vma->vm_pgoff);
|
||||
end:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int msm_open_config(struct inode *inode, struct file *fp)
|
||||
{
|
||||
int rc;
|
||||
|
@ -2944,12 +2910,6 @@ static long msm_ioctl_config(struct file *fp, unsigned int cmd,
|
|||
rc = msm_v4l2_evt_notify(config_cam->p_mctl, cmd, arg);
|
||||
break;
|
||||
|
||||
case MSM_CAM_IOCTL_SET_MEM_MAP_INFO:
|
||||
if (copy_from_user(&config_cam->mem_map, (void __user *)arg,
|
||||
sizeof(struct msm_mem_map_info)))
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
|
||||
case MSM_CAM_IOCTL_SET_MCTL_SDEV:{
|
||||
struct msm_mctl_set_sdev_data set_data;
|
||||
if (copy_from_user(&set_data, (void __user *)arg,
|
||||
|
@ -3011,7 +2971,6 @@ static const struct file_operations msm_fops_config = {
|
|||
.open = msm_open_config,
|
||||
.poll = msm_poll_config,
|
||||
.unlocked_ioctl = msm_ioctl_config,
|
||||
.mmap = msm_mmap_config,
|
||||
.release = msm_close_config,
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue