public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* failure in /mm/memory.c
@ 2004-10-16 11:32 christophpfister
  2004-10-16 12:09 ` William Lee Irwin III
  0 siblings, 1 reply; 4+ messages in thread
From: christophpfister @ 2004-10-16 11:32 UTC (permalink / raw)
  To: linux-kernel

hello

i found a failure in function remap_pte_range in memory.c

static inline void remap_pte_range(...)
{
unsigned long end;
unsigned long pfn;
address &= ~PMD_MASK;
end = address + size;
if (end > PMD_SIZE)
    end = PMD_SIZE;
pfn = phys_addr >> PAGE_SHIFT;
do {
    BUG_ON(!pte_none(*pte));
    if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn))) *****
      set_pte(pte, pfn_pte(pfn, prot));
    address += PAGE_SIZE;
    pfn++;
    pte++;
    } while (address && (address < end));
}

by ****

the condition is wrong, because it just maps the page, if it's invalid or
reserved

correct: if (!(pfn_valid(pfn) || PageReserved(pfn_to_page(pfn))))

(it doesn't seems to be used, otherwise there must be bugs)

Yours sincerely,

Christoph Pfister


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-17  3:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-16 11:32 failure in /mm/memory.c christophpfister
2004-10-16 12:09 ` William Lee Irwin III
2004-10-17  2:33   ` Alan Cox
2004-10-17  3:40     ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox