From 83af8eda68a3f0c227d0eb05348e58ae27a62e7e Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Sat, 2 Feb 2008 03:08:53 +0100 Subject: 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 Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- kernel/relay.c | 1 + 1 file changed, 1 insertion(+) (limited to 'kernel') diff --git a/kernel/relay.c b/kernel/relay.c index 95db8c79fe8f..24db7e81cde4 100644 --- a/kernel/relay.c +++ b/kernel/relay.c @@ -91,6 +91,7 @@ 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); -- cgit v1.2.3