[lkml]   [2001]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectminor mmap bug ?


In do_mmap_pgoff() :

422 addr = get_unmapped_area(file, addr, len, pgoff, flags);
423 if (addr & ~PAGE_MASK)
424 return addr;

in get_unmapped_area() :

621 if (flags & MAP_FIXED) {
622 if (addr > TASK_SIZE - len)
623 return -EINVAL;
624 if (addr & ~PAGE_MASK)
625 return -EINVAL;
626 return addr;
627 }

So it seems that if we hit the first case (addr > TASK_SIZE - len),
we don't return with EINVAL immediately. This code is a little weird anyway.

Is this a bug ?

Also, what's the reason for :

405 if ((len = PAGE_ALIGN(len)) == 0)
406 return addr;

Also, shouldn't calc_vm_flags() mention MAP_LOCKED and the others specifically ?
The current "oh, it happens to be the same value" is distinctly non-obvious to me.

Also, why do several (all ?) of the do_mmap2()s do this :


Is it something to do with mm->def_flags ?


" It is quite humbling to realize that the storage occupied by the longest line
from a typical Usenet posting is sufficient to provide a state space so vast
that all the computation power in the world can not conquer it."
- Dave Wallace
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:04    [W:0.044 / U:1.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site