linux/drivers/staging/tidspbridge/rmgr
Ivaylo Dimitrov 559c71fe5d Staging: TIDSPBRIDGE: Use vm_iomap_memory for mmap-ing instead of remap_pfn_range
This fixes the following bug:

----  Bug Report ----

source file: drivers/staging/tidspbridge/rmgr/drv_interface.c
issue      : mapping of physical memory without address range checks

259 static int bridge_mmap(struct file *filp, struct vm_area_struct *vma)
260 {
261         u32 status;
262
263         /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */
264         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
265
266         dev_dbg(bridge, "%s: vm filp %p start %lx end %lx page_prot %ulx "
267                 "flags %lx\n", __func__, filp,
268                 vma->vm_start, vma->vm_end, vma->vm_page_prot,
269                 vma->vm_flags);
270
271         status = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
272                                  vma->vm_end - vma->vm_start,
273                                  vma->vm_page_prot);
274         if (status != 0)
275                 status = -EAGAIN;
276
277         return status;
278 }

The function provides an interface to remap physical memory to user space, but
does not provide any checks to ensure that the memory is within the region that
should be accessible.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Ivaylo Dimitrov <freemangordon@abv.bg>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03 09:42:45 -08:00
..
dbdcd.c staging: tidspbridge: fix memory corruption on long string names 2013-01-17 16:47:13 -08:00
disp.c staging: tidspbridge: remove disp_init() and disp_exit() 2012-03-09 13:21:06 -08:00
drv.c tidspbridge: convert to idr_alloc() 2013-03-13 15:21:47 -07:00
drv_interface.c Staging: TIDSPBRIDGE: Use vm_iomap_memory for mmap-ing instead of remap_pfn_range 2013-12-03 09:42:45 -08:00
dspdrv.c Staging: tidspbridge: fix no space before tabs 2013-10-06 22:07:30 -07:00
mgr.c staging: tidspbridge: Fix typos. 2012-08-13 19:06:59 -07:00
nldr.c staging: tidspbridge: fix uninitialized variable sym_name 2013-01-17 16:47:13 -08:00
node.c staging: tidspbridge: fix uninitialized variable sym_name 2013-01-17 16:47:13 -08:00
proc.c staging: tidspbridge: rmgr: proc.c: fix checkpatch errors 2013-03-25 11:02:56 -07:00
pwr.c staging: tidspbridge: set4 remove hungarian from structs 2011-02-04 20:12:13 -06:00
rmm.c staging: tidspbridge: remove rmm_init() and rmm_exit() 2012-03-09 13:21:07 -08:00
strm.c staging:tidspbridge: rmgr: fix checkpatch errors 2013-03-25 11:02:55 -07:00