mremap vulnerability patch for WOLK

Kerin Millar <[email protected]> Mon, 5 Jan 2004 14:15:19 +0000
Newsgroups gmane.linux.wolk.devel
Message-ID <[email protected]>
Hi,

you can fix up WOLK (most kernels, in fact) with regard to the security flaw described by CAN-2003-0985 by using the patch below. Note that this is the "proper" patch approved by Linus, not the deprecated one which unfortunately made it into the official 2.4.24 release.

--- linux/mm/mremap.c.orig      2004-01-05 17:01:21.382104120 +0000
+++ linux/mm/mremap.c   2004-01-05 17:15:25.689749848 +0000
@@ -315,6 +315,10 @@
        old_len = PAGE_ALIGN(old_len);
        new_len = PAGE_ALIGN(new_len);
 
+       /* Don't allow the degenerate cases */
+       if (!(old_len | new_len))
+               goto out;
+
        /* new_addr is only valid if MREMAP_FIXED is specified */
        if (flags & MREMAP_FIXED) {
                if (new_addr & ~PAGE_MASK)

--Kerin Millar


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
WOLK - Working Overloaded Linux Kernel
[email protected]
https://lists.sourceforge.net/lists/listinfo/wolk-devel