Re: do_mmap()

Gerard Roudier (groudier@club-internet.fr)
Sat, 16 Nov 1996 21:39:13 +0000 (GMT)


Seems to me that this code get from user the 1st byte of each page of the
memory area to map. So, if user lies to Linux, an exception will occur.

Gerard.

On Sat, 16 Nov 1996, David L. Oppenheimer wrote:

>
> Does anyone know what the purpose of this piece of code is? (It appears at the
> end of do_mmap() in mm/mmap.c)
>
> if (flags & VM_LOCKED) {
> unsigned long start = addr;
> mm->locked_vm += len >> PAGE_SHIFT;
> do {
> char c = get_user((char *) start);
> len -= PAGE_SIZE;
> start += PAGE_SIZE;
> __asm__ __volatile__("": :"r" (c));
> } while (len > 0);
> }