Skip to content

Commit

Permalink
[VIDEO] sbuslib: Disallow private mmaps.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Dec 24, 2005
1 parent 597d1f0 commit e445ee6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/video/sbuslib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e445ee6

Please sign in to comment.