linux-mips
[Top] [All Lists]

PATCH: Fix offset of mmap

To: linux-mips@oss.sgi.com
Subject: PATCH: Fix offset of mmap
From: "H . J . Lu" <hjl@lucon.org>
Date: Fri, 14 Sep 2001 10:07:00 -0700
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.2.5i
We should check if offset of mmap is on the page boundary.


H.J.
---
--- /tmp/tmp.20947.0    Fri Sep 14 10:05:33 2001
+++ arch/mips/kernel/syscall.c  Fri Sep 14 10:05:08 2001
@@ -82,6 +82,8 @@ out:
 asmlinkage unsigned long old_mmap(unsigned long addr, size_t len, int prot,
                                   int flags, int fd, off_t offset)
 {
+       if (offset & ~PAGE_MASK)
+               return -EINVAL;
        return do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
 }
 

<Prev in Thread] Current Thread [Next in Thread>