From: David S. Miller Date: Sat, 24 Dec 2005 20:06:10 +0000 (-0800) Subject: [VIDEO] sbuslib: Disallow private mmaps. X-Git-Tag: v2.6.15-rc7~3^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e445ee65cbefaa19131c972ae7fe221c95cf4cc4;p=linux-2.6 [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 --- diff --git a/drivers/video/sbuslib.c b/drivers/video/sbuslib.c index 646c43f921..3a74a63dd4 100644 --- a/drivers/video/sbuslib.c +++ b/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;