Permalink
Browse files

Revert "exynos_mem: an alternative temporary workaround for exynos-me…

…m security hole"

This reverts commit d7818fc.
  • Loading branch information...
1 parent 800f239 commit 769b1c5baecc4b0e08dcb526c5065a0d25482fea @gokhanmoral committed Jan 11, 2013
Showing with 0 additions and 48 deletions.
  1. +0 −43 arch/arm/plat-s5p/reserve_mem.c
  2. +0 −5 drivers/char/exynos_mem.c
@@ -22,56 +22,13 @@
#ifdef CONFIG_CMA
#include <linux/cma.h>
-
-static struct cma_region *p_regions;
-static struct cma_region *p_regions_secure;
-static int size_p_regions, size_p_regions_secure;
-
-#define return1IfNotInRange(addr, size, cma_addr, cma_size) \
- if(addr >= cma_addr && addr + size <= cma_addr + cma_size) return 1;
-
-int s5p_is_cma_region(phys_addr_t addr, size_t size)
-{
- int i;
- for(i=0; i < size_p_regions; i++)
- return1IfNotInRange(addr, size, p_regions[i].start, p_regions[i].size);
- for(i=0; i < size_p_regions_secure; i++)
- return1IfNotInRange(addr, size, p_regions_secure[i].start, p_regions_secure[i].size);
-
-#if defined(CONFIG_MACH_M0)
-#ifdef CONFIG_USE_FIMC_CMA
- return1IfNotInRange(addr, size, 0x65800000, CONFIG_VIDEO_SAMSUNG_MEMSIZE_FIMC1 * SZ_1K);
-#endif
-#if defined(CONFIG_USE_MFC_CMA)
- return1IfNotInRange(addr, size, 0x5C800000, 0x02800000);
-#endif
-#endif
-
-#if defined(CONFIG_MACH_U1)
-#ifdef CONFIG_USE_TVOUT_CMA
- return1IfNotInRange(addr, size, 0x65800000, CONFIG_VIDEO_SAMSUNG_MEMSIZE_TVOUT * SZ_1K);
-#endif
-#ifdef CONFIG_USE_MFC_CMA
- return1IfNotInRange(addr, size, 0x67800000, 40 * SZ_1M);
-#endif
-#endif
-
- return 0;
-}
-
void __init s5p_cma_region_reserve(struct cma_region *regions_normal,
struct cma_region *regions_secure,
size_t align_secure, const char *map)
{
struct cma_region *reg;
phys_addr_t paddr_last = 0xFFFFFFFF;
- p_regions = regions_normal;
- p_regions_secure = regions_secure;
- size_p_regions = 0; size_p_regions_secure = 0;
- for (reg = regions_normal; reg->size != 0; reg++) size_p_regions++;
- for (reg = regions_secure; reg->size != 0; reg++) size_p_regions_secure++;
-
for (reg = regions_normal; reg->size != 0; reg++) {
phys_addr_t paddr;
@@ -241,8 +241,6 @@ static struct vm_operations_struct exynos_mem_ops = {
.close = exynos_mem_mmap_close,
};
-extern int s5p_is_cma_region(phys_addr_t addr, size_t size);
-
int exynos_mem_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct exynos_mem *mem = (struct exynos_mem *)filp->private_data;
@@ -259,9 +257,6 @@ int exynos_mem_mmap(struct file *filp, struct vm_area_struct *vma)
pfn = mem->phybase;
}
- if(!s5p_is_cma_region(start, size))
- return -EINVAL;
-
/* TODO: currently lowmem is only avaiable */
if ((phys_to_virt(start) < (void *)PAGE_OFFSET) ||
(phys_to_virt(start) >= high_memory)) {

0 comments on commit 769b1c5

Please sign in to comment.