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:
Ajay Dudani 2013-06-18 00:12:07 -07:00 committed by Iliyan Malchev
parent 4feaaa3c74
commit 449d60889d

View file

@ -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,
};