diff options
author | Nick Piggin <npiggin@suse.de> | 2008-02-02 03:08:53 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-08 11:46:21 -0800 |
commit | f5871b9016c0ebce8acc58f7a230adcb9bd89577 (patch) | |
tree | ced41f583da6ac27c4c083d35f44dacb781fad36 /kernel | |
parent | f4ae0ab4b8237848ad5d687342a10cd3b7037705 (diff) |
vm audit: add VM_DONTEXPAND to mmap for drivers that need it (CVE-2008-0007)
Drivers that register a ->fault handler, but do not range-check the
offset argument, must set VM_DONTEXPAND in the vm_flags in order to
prevent an expanding mremap from overflowing the resource.
I've audited the tree and attempted to fix these problems (usually by
adding VM_DONTEXPAND where it is not obvious).
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/relay.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/relay.c b/kernel/relay.c index 61134eb7a0c..7c0373322f1 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -92,6 +92,7 @@ static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) return -EINVAL; vma->vm_ops = &relay_file_mmap_ops; + vma->vm_flags |= VM_DONTEXPAND; vma->vm_private_data = buf; buf->chan->cb->buf_mapped(buf, filp); |