On Sat, Aug 13, 2005 at 10:37:03AM -0700, Linus Torvalds wrote: > > > On Sat, 13 Aug 2005, Arjan van de Ven wrote: > > > > attached is the same patch but now with Steven's change made as well > > Actually, the more I looked at that mmap_kmem() function, the less I liked > it. Let's get that sucker fixed better first. It's still not wonderful, > but at least now it tries to verify the whole _range_ of the mapping. > > Steven, does this "alternate mmap_kmem fix" patch work for you? > > Linus > ---- > diff --git a/drivers/char/mem.c b/drivers/char/mem.c > --- a/drivers/char/mem.c > +++ b/drivers/char/mem.c > @@ -261,7 +261,11 @@ static int mmap_mem(struct file * file, > > static int mmap_kmem(struct file * file, struct vm_area_struct * vma) > { > - unsigned long long val; > + unsigned long pfn, size; > + > + /* Turn a kernel-virtual address into a physical page frame */ > + pfn = __pa((u64)vma->vm_pgoff << PAGE_SHIFT) >> PAGE_SHIFT; > + ARCH=um doesnt like your version, but mine. drivers/char/mem.c:267: error: invalid operands to binary << pfn = (__pa((u64)vma->vm_pgoff) << PAGE_SHIFT) >> PAGE_SHIFT; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Jeff Dike <jdike@addtoit.com>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- References:
- [question] What's the difference between /dev/kmem and /dev/mem
- From: Steven Rostedt <rostedt@goodmis.org>
- [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Steven Rostedt <rostedt@goodmis.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Arjan van de Ven <arjan@infradead.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Linus Torvalds <torvalds@osdl.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Arjan van de Ven <arjan@infradead.org>
- Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- From: Linus Torvalds <torvalds@osdl.org>
- [question] What's the difference between /dev/kmem and /dev/mem
- Prev by Date: Re: Atyfb questions and issues
- Next by Date: Re: [PATCH] to drivers/input/evdev.c to add mixer device "/dev/input/events"
- Previous by thread: Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- Next by thread: Re: [PATCH] Fix mmap_kmem (was: [question] What's the difference between /dev/kmem and /dev/mem)
- Index(es):
