failure in /mm/memory.c

From: christophpfister
Date: Sat Oct 16 2004 - 06:33:57 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/