瀏覽代碼

[VIDEO] sbuslib: Disallow private mmaps.

The COW semantics just do not make any sense especially
with the physically discontiguous I/O mappings possible
here.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 19 年之前
父節點
當前提交
e445ee65cb
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/video/sbuslib.c

+ 3 - 0
drivers/video/sbuslib.c

@@ -46,6 +46,9 @@ int sbusfb_mmap_helper(struct sbus_mmap_map *map,
 	unsigned long off;
 	int i;
                                         
+	if (!(vma->vm_flags & (VM_SHARED | VM_MAYSHARE)))
+		return -EINVAL;
+
 	size = vma->vm_end - vma->vm_start;
 	if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT))
 		return -EINVAL;