Re: don't let mmap allocate down to zero

From: Rik van Riel
Date: Thu Jan 27 2005 - 16:11:25 EST


On Thu, 27 Jan 2005, William Lee Irwin III wrote:

(b) sys_mremap() isn't covered.

AFAICS it is covered.

--- mm1-2.6.11-rc2.orig/mm/mremap.c 2005-01-26 00:26:43.000000000 -0800
+++ mm1-2.6.11-rc2/mm/mremap.c 2005-01-27 12:34:34.000000000 -0800
@@ -297,6 +297,8 @@
if (flags & MREMAP_FIXED) {
if (new_addr & ~PAGE_MASK)
goto out;
+ if (!new_addr)
+ goto out;

This looks broken, look at the MREMAP_FIXED part...

--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/