PATCH: Fix offset of mmap
We should check if offset of mmap is on the page boundary.
H.J.
---
mips/kernel/syscall.c renamed from tmp/tmp.20947.0 +2 -0
@@ -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 ); }
Quoted 2 lines
We should check if offset of mmap is on the page boundary.
I believe this would break certain pieces of hardware. For example the mq200 framebuffer in the sigmarion is not paged aligned. You have to supply a offset to make it work.
Quoted 6 lines · James Simmons
Quoted 2 lines
We should check if offset of mmap is on the page boundary.
I believe this would break certain pieces of hardware. For example the mq200 framebuffer in the sigmarion is not paged aligned. You have to supply a offset to make it work.
How do you mmap a memory whose offset is not page aligned? The code here is
return do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
^^^^^^^^^^^^^^^^^^^^
It is up to the user code to make sure everything is ok.
H.J.
Quoted 5 lines
Quoted 4 lines
I believe this would break certain pieces of hardware. For example the mq200 framebuffer in the sigmarion is not paged aligned. You have to supply a offset to make it work.
Quoted 7 lines
How do you mmap a memory whose offset is not page aligned? The code here is
return
do_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);^^^^^^^^^^^^^^^^^^^^It is up to the user code to make sure everything is ok.
Sorry. Mix up in the meaning of offset.